@@ -117,7 +117,7 @@ $cell-negative-space-vertical: 2px;
117117 }
118118}
119119@mixin body-cell-active-hover-padding ($padding-start ) {
120- & :not (.body-cell-edit-active ).body-cell-editable :hover {
120+ & :not (.body-cell-edit-active ):not ( .body-cell-expandable ) .body-cell-editable :hover {
121121 @include cell-padding-inline-start (calc (#{$padding-start } + #{awsui .$border-divider-list-width } ));
122122 }
123123}
@@ -358,8 +358,8 @@ $cell-negative-space-vertical: 2px;
358358 background : 0 ;
359359 border-block : 0 ;
360360 border-inline : 0 ;
361- padding-block : 0 ;
362- padding-inline : 0 ;
361+ padding-block : awsui . $space-scaled-xxs ;
362+ padding-inline : awsui . $space-scaled-xxs ;
363363
364364 // This gives the editor button a small area even when the icon is not rendered.
365365 // That is to allow programmatic interaction in tests.
@@ -394,6 +394,12 @@ $cell-negative-space-vertical: 2px;
394394 // 6 space-xxs: 2 * icon left padding + 2 * icon right padding + space between icons + space between icons and editor
395395 max-inline-size : calc (100% - 6 * #{awsui .$space-xxs } - 2 * #{awsui .$size-icon-normal } );
396396 }
397+
398+ & -focusable {
399+ @include focus-visible .when-visible {
400+ @include styles .focus-highlight (awsui .$space-button-focus-outline-gutter );
401+ }
402+ }
397403 }
398404
399405 & .body-cell-expandable {
@@ -422,8 +428,6 @@ $cell-negative-space-vertical: 2px;
422428 }
423429
424430 & :not (.body-cell-edit-active ) {
425- cursor : pointer ;
426-
427431 // Include interactive padding even when a cell is not hovered to prevent jittering when resizableColumns=false.
428432 & :not (.resizable-columns ) {
429433 @include cell-padding-inline-end ($interactive-column-padding-inline-end );
@@ -444,13 +448,13 @@ $cell-negative-space-vertical: 2px;
444448 opacity : 0 ;
445449 }
446450
447- // Showing focus outline for the cell .
448- // We don't use our focus-visible polyfill here because it doesn't work properly with screen readers .
449- // These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology .
450- // It's therefore important to display the focus outline, even when a keyboard use wasn't detected.
451- // For example, when an edit button is selected from the VoiceOver rotor menu.
452- & : focus-within {
453- @include cell-focus-outline ;
451+ // The editable cells are interactive but the actual focus lands on the edit button which is decorative .
452+ // That is why we use focus-within to detect if the focus is on the edit button to draw the outline around the cell .
453+ // For expandable+editable cells the edit button works as a normal button because the cell itself is not interactive .
454+ & :not ( .body-cell-expandable ) {
455+ & :focus-within {
456+ @include cell- focus-outline ;
457+ }
454458 }
455459
456460 & :focus-within:focus-within ,
@@ -470,10 +474,14 @@ $cell-negative-space-vertical: 2px;
470474 & :hover:hover {
471475 position : relative ;
472476
473- background-color : awsui .$color-background-dropdown-item-hover ;
474- border-block : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
475- border-inline : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
476- inset-inline : calc (-1 * #{awsui .$border-divider-list-width } );
477+ & :not (.body-cell-expandable ) {
478+ cursor : pointer ;
479+ background-color : awsui .$color-background-dropdown-item-hover ;
480+ border-block : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
481+ border-inline : awsui .$border-divider-list-width solid awsui .$color-border-editable-cell-hover ;
482+ inset-inline : calc (-1 * #{awsui .$border-divider-list-width } );
483+ }
484+
477485 & .sticky-cell {
478486 position : sticky ;
479487 }
@@ -504,12 +512,12 @@ $cell-negative-space-vertical: 2px;
504512 & .body-cell-next-selected {
505513 @include cell-padding-block (calc (#{$cell-vertical-padding } - calc (#{awsui .$border-divider-list-width } / 2 )));
506514 }
507- & .body-cell-last-row :not (.body-cell-selected ) {
515+ & .body-cell-last-row :not (.body-cell-expandable ) :not ( .body-cell- selected ) {
508516 @include cell-padding-block-start (
509517 calc (#{$cell-vertical-padding } - calc (#{awsui .$border-divider-list-width } ))
510518 );
511519 }
512- & .body-cell-first-row :not (.body-cell-selected ) {
520+ & .body-cell-first-row :not (.body-cell-expandable ) :not ( .body-cell- selected ) {
513521 @include cell-padding-block (calc (#{$cell-vertical-padding } - calc (#{awsui .$border-divider-list-width } )));
514522 }
515523 @include focused-editor-styles ;
0 commit comments