@@ -219,7 +219,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
219
219
padding-block-start : $cell-vertical-padding ;
220
220
}
221
221
222
- & -editor {
222
+ & -editor-wrapper {
223
223
padding-block : 0 ;
224
224
padding-inline-start : 0 ;
225
225
padding-inline-end : $edit-button-padding-right ;
@@ -232,24 +232,34 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
232
232
}
233
233
234
234
& -success ,
235
- & -editor {
235
+ & -editor-wrapper {
236
236
inset-block : 0 ;
237
237
inset-inline-end : 0 ;
238
238
position : absolute ;
239
239
240
240
display : flex ;
241
241
align-items : center ;
242
242
justify-content : flex-end ;
243
-
243
+ }
244
+ & -editor {
244
245
// Reset some native <button> styles
245
246
cursor : pointer ;
246
247
outline : 0 ;
247
248
background : 0 ;
248
249
border-block : 0 ;
249
250
border-inline : 0 ;
251
+ padding-block : 0 ;
252
+ padding-inline : 0 ;
250
253
251
- color : awsui .$color-text-button-normal-default ;
254
+ // This gives the editor button a small area even when the icon is not rendered.
255
+ // That is to allow programmatic interaction in tests.
256
+ min-block-size : 10px ;
257
+ min-inline-size : 10px ;
252
258
259
+ color : awsui .$color-text-button-normal-default ;
260
+ & -disabled {
261
+ color : awsui .$color-text-disabled-inline-edit ;
262
+ }
253
263
& :hover {
254
264
color : awsui .$color-text-button-normal-hover ;
255
265
}
@@ -285,13 +295,8 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
285
295
}
286
296
}
287
297
288
- & .body-cell-disabled-edit > .body-cell-editor {
289
- color : awsui .$color-text-disabled-inline-edit ;
290
- }
291
-
292
298
& .body-cell-editable {
293
299
position : relative ;
294
- cursor : pointer ;
295
300
296
301
& .sticky-cell {
297
302
position : sticky ;
@@ -305,32 +310,43 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
305
310
}
306
311
307
312
& :not (.body-cell-edit-active ) {
313
+ cursor : pointer ;
314
+
308
315
@mixin focused-editor-styles {
309
316
padding-inline-end : calc (#{$cell-horizontal-padding } + #{awsui .$space-l } );
310
- & > .body-cell-editor {
317
+ & > .body-cell-editor-wrapper {
311
318
opacity : 1 ;
312
319
}
313
320
& > .body-cell-success {
314
321
opacity : 1 ;
315
322
}
316
323
}
317
- & > .body-cell-editor {
324
+ & > .body-cell-editor-wrapper {
318
325
opacity : 0 ;
319
326
}
327
+
328
+ // Showing focus outline for the cell.
320
329
// We don't use our focus-visible polyfill here because it doesn't work properly with screen readers.
321
330
// These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology.
322
331
// It's therefore important to display the focus outline, even when a keyboard user wasn't detected.
323
332
// For example, when an edit button is selected from the VoiceOver rotor menu.
324
- & :focus-within {
333
+ & .body-cell-interactive :focus-within {
325
334
@include styles .focus-highlight (
326
335
(
327
336
' vertical' : calc (-1 * #{awsui .$space-scaled-xxs } ),
328
337
' horizontal' : calc (-1 * #{awsui .$space-scaled-xxs } ),
329
338
)
330
339
);
331
340
}
341
+ // When a cell is not interactive the focus outline must be present for the editor button.
342
+ & :not (.body-cell-interactive ) > .body-cell-editor-wrapper > .body-cell-editor {
343
+ @include focus-visible .when-visible {
344
+ @include styles .focus-highlight (awsui .$space-button-inline-icon-focus-outline-gutter );
345
+ }
346
+ }
332
347
333
- & :focus-within ,
348
+ & :not (.body-cell-interactive ),
349
+ & :focus-within:focus-within ,
334
350
& .body-cell-edit-disabled-popover {
335
351
padding-inline-end : calc (#{$cell-horizontal-padding } + #{awsui .$space-l } );
336
352
& .body-cell-has-success {
@@ -343,7 +359,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
343
359
}
344
360
}
345
361
346
- & :hover {
362
+ & .body-cell-interactive :hover {
347
363
background-color : awsui .$color-background-dropdown-item-hover ;
348
364
border-block : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
349
365
border-inline : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
@@ -354,7 +370,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
354
370
inset-inline : 0 ;
355
371
}
356
372
357
- & > .body-cell-editor {
373
+ & > .body-cell-editor-wrapper {
358
374
padding-inline-end : calc (#{$edit-button-padding-right } - (2 * #{awsui .$border-divider-list-width } ));
359
375
}
360
376
& > .body-cell-success {
@@ -388,7 +404,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
388
404
border-end-end-radius : awsui .$border-radius-item ;
389
405
}
390
406
& .body-cell-first-row > .body-cell-success ,
391
- & .body-cell-first-row > .body-cell-editor {
407
+ & .body-cell-first-row > .body-cell-editor-wrapper {
392
408
padding-block-start : awsui .$border-divider-list-width ;
393
409
}
394
410
}
0 commit comments