Skip to content

Commit 63c8953

Browse files
authored
fix(module:image): remove inline style (CSP compliant) (#8876)
1 parent decd477 commit 63c8953

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

components/image/image-preview.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const NZ_DEFAULT_ROTATE = 0;
104104
(click)="maskClosable && $event.target === $event.currentTarget && onClose()"
105105
>
106106
<div class="ant-image-preview" role="dialog" aria-modal="true">
107-
<div tabindex="0" aria-hidden="true" style="width: 0; height: 0; overflow: hidden; outline: none;"></div>
107+
<div tabindex="0" aria-hidden="true" class="ant-image-preview-focus-trap"></div>
108108
<div class="ant-image-preview-content">
109109
<div class="ant-image-preview-body">
110110
<div
@@ -133,7 +133,7 @@ const NZ_DEFAULT_ROTATE = 0;
133133
</div>
134134
</div>
135135
</div>
136-
<div tabindex="0" aria-hidden="true" style="width: 0; height: 0; overflow: hidden; outline: none;"></div>
136+
<div tabindex="0" aria-hidden="true" class="ant-image-preview-focus-trap"></div>
137137
</div>
138138
</div>
139139
`,

components/image/style/index.less

+7
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,12 @@
199199
&-switch-right {
200200
right: 8px;
201201
}
202+
203+
&-focus-trap {
204+
width: 0;
205+
height: 0;
206+
overflow: hidden;
207+
outline: none;
208+
}
202209
}
203210
}

0 commit comments

Comments
 (0)