@@ -219,7 +219,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
219219 padding-block-start : $cell-vertical-padding ;
220220 }
221221
222- & -editor {
222+ & -editor-wrapper {
223223 padding-block : 0 ;
224224 padding-inline-start : 0 ;
225225 padding-inline-end : $edit-button-padding-right ;
@@ -232,24 +232,34 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
232232 }
233233
234234 & -success ,
235- & -editor {
235+ & -editor-wrapper {
236236 inset-block : 0 ;
237237 inset-inline-end : 0 ;
238238 position : absolute ;
239239
240240 display : flex ;
241241 align-items : center ;
242242 justify-content : flex-end ;
243-
243+ }
244+ & -editor {
244245 // Reset some native <button> styles
245246 cursor : pointer ;
246247 outline : 0 ;
247248 background : 0 ;
248249 border-block : 0 ;
249250 border-inline : 0 ;
251+ padding-block : 0 ;
252+ padding-inline : 0 ;
250253
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 ;
252258
259+ color : awsui .$color-text-button-normal-default ;
260+ & -disabled {
261+ color : awsui .$color-text-disabled-inline-edit ;
262+ }
253263 & :hover {
254264 color : awsui .$color-text-button-normal-hover ;
255265 }
@@ -285,13 +295,8 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
285295 }
286296 }
287297
288- & .body-cell-disabled-edit > .body-cell-editor {
289- color : awsui .$color-text-disabled-inline-edit ;
290- }
291-
292298 & .body-cell-editable {
293299 position : relative ;
294- cursor : pointer ;
295300
296301 & .sticky-cell {
297302 position : sticky ;
@@ -305,32 +310,43 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
305310 }
306311
307312 & :not (.body-cell-edit-active ) {
313+ cursor : pointer ;
314+
308315 @mixin focused-editor-styles {
309316 padding-inline-end : calc (#{$cell-horizontal-padding } + #{awsui .$space-l } );
310- & > .body-cell-editor {
317+ & > .body-cell-editor-wrapper {
311318 opacity : 1 ;
312319 }
313320 & > .body-cell-success {
314321 opacity : 1 ;
315322 }
316323 }
317- & > .body-cell-editor {
324+ & > .body-cell-editor-wrapper {
318325 opacity : 0 ;
319326 }
327+
328+ // Showing focus outline for the cell.
320329 // We don't use our focus-visible polyfill here because it doesn't work properly with screen readers.
321330 // These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology.
322331 // It's therefore important to display the focus outline, even when a keyboard user wasn't detected.
323332 // For example, when an edit button is selected from the VoiceOver rotor menu.
324- & :focus-within {
333+ & .body-cell-interactive :focus-within {
325334 @include styles .focus-highlight (
326335 (
327336 ' vertical' : calc (-1 * #{awsui .$space-scaled-xxs } ),
328337 ' horizontal' : calc (-1 * #{awsui .$space-scaled-xxs } ),
329338 )
330339 );
331340 }
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+ }
332347
333- & :focus-within ,
348+ & :not (.body-cell-interactive ),
349+ & :focus-within:focus-within ,
334350 & .body-cell-edit-disabled-popover {
335351 padding-inline-end : calc (#{$cell-horizontal-padding } + #{awsui .$space-l } );
336352 & .body-cell-has-success {
@@ -343,7 +359,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
343359 }
344360 }
345361
346- & :hover {
362+ & .body-cell-interactive :hover {
347363 background-color : awsui .$color-background-dropdown-item-hover ;
348364 border-block : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
349365 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-
354370 inset-inline : 0 ;
355371 }
356372
357- & > .body-cell-editor {
373+ & > .body-cell-editor-wrapper {
358374 padding-inline-end : calc (#{$edit-button-padding-right } - (2 * #{awsui .$border-divider-list-width } ));
359375 }
360376 & > .body-cell-success {
@@ -388,7 +404,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
388404 border-end-end-radius : awsui .$border-radius-item ;
389405 }
390406 & .body-cell-first-row > .body-cell-success ,
391- & .body-cell-first-row > .body-cell-editor {
407+ & .body-cell-first-row > .body-cell-editor-wrapper {
392408 padding-block-start : awsui .$border-divider-list-width ;
393409 }
394410 }
0 commit comments