Skip to content

Commit

Permalink
[EuiDraggable] Convert broken focus styles
Browse files Browse the repository at this point in the history
`euiFocusRing` mixin doesn't work because of `:focus-visible`

prefer just an auto outline to match prod behavior, the outline is just more focused on the child item

not sure what the custom drag handle CSS is for, drag handle focus outlines work fine as-is
  • Loading branch information
cee-chen committed Sep 14, 2023
1 parent 03341cc commit 6e1823e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/components/drag_and_drop/_draggable.scss
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
.euiDraggable {
&:focus > .euiDraggable__item,
&.euiDraggable--hasCustomDragHandle > .euiDraggable__item [data-react-beautiful-dnd-drag-handle]:focus {
@include euiFocusRing;
}
}
8 changes: 8 additions & 0 deletions src/components/drag_and_drop/draggable.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ export const euiDraggableStyles = (euiThemeContext: UseEuiTheme) => {

return {
euiDraggable: css`
&:focus {
outline: none;
& > .euiDraggable__item {
outline: auto;
}
}
/* !importants in this file override inline styles on JS-inserted HTML elements */
/* stylelint-disable declaration-no-important */
`,
Expand Down

0 comments on commit 6e1823e

Please sign in to comment.