Skip to content

Commit

Permalink
fix(module:image): remove inline style (CSP compliant) (#8876)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored Nov 14, 2024
1 parent decd477 commit 63c8953
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/image/image-preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const NZ_DEFAULT_ROTATE = 0;
(click)="maskClosable && $event.target === $event.currentTarget && onClose()"
>
<div class="ant-image-preview" role="dialog" aria-modal="true">
<div tabindex="0" aria-hidden="true" style="width: 0; height: 0; overflow: hidden; outline: none;"></div>
<div tabindex="0" aria-hidden="true" class="ant-image-preview-focus-trap"></div>
<div class="ant-image-preview-content">
<div class="ant-image-preview-body">
<div
Expand Down Expand Up @@ -133,7 +133,7 @@ const NZ_DEFAULT_ROTATE = 0;
</div>
</div>
</div>
<div tabindex="0" aria-hidden="true" style="width: 0; height: 0; overflow: hidden; outline: none;"></div>
<div tabindex="0" aria-hidden="true" class="ant-image-preview-focus-trap"></div>
</div>
</div>
`,
Expand Down
7 changes: 7 additions & 0 deletions components/image/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,12 @@
&-switch-right {
right: 8px;
}

&-focus-trap {
width: 0;
height: 0;
overflow: hidden;
outline: none;
}
}
}

0 comments on commit 63c8953

Please sign in to comment.