[ES|QL] LOOKUP JOIN - Keyboard accessibility improvements#229907
[ES|QL] LOOKUP JOIN - Keyboard accessibility improvements#229907sddonne merged 14 commits intoelastic:feature/lookup-join-uxfrom
Conversation
| ...column, | ||
| display: <AddColumnHeader initialColumnName={initialColumnName} />, | ||
| display: <AddColumnHeader initialColumnName={columnName} containerId={column.id} />, | ||
| displayHeaderCellProps: { |
There was a problem hiding this comment.
DataGrid exposes the method setFocusedCell for cells, but not way of focusing headers.
The way of achieving this is using a data prop and then select the html element manually.
|
|
||
| export type OnCellValueChange = (docId: string, update: any) => void; | ||
|
|
||
| export const getValueInputPopover = |
There was a problem hiding this comment.
The input for the cell is no longer in the cell body, now it's displayed as a popup with this method.
| } | ||
| return acc; | ||
| }, []) | ||
| take(1), |
There was a problem hiding this comment.
Now we set the placeholders as unsaved columns initial value.
| onInitialStateChange={onInitialStateChange} | ||
| > | ||
| <ComponentMemoized {...(props as TProps)} /> | ||
| {/* @ts-ignore */} |
There was a problem hiding this comment.
Couldn't pass through this type check..
There was a problem hiding this comment.
If you have no other options but using ts-ignore, we should also mentioned the suppressing error. But I wonder if you can make it work with generics?
…com/sddonne/kibana into lookup-join/accesibility-new-branch
...kages/private/kbn-index-editor/src/components/grid_custom_renderers/column_input_control.tsx
Outdated
Show resolved
Hide resolved
...ckages/private/kbn-index-editor/src/components/grid_custom_renderers/value_input_control.tsx
Outdated
Show resolved
Hide resolved
...ckages/private/kbn-index-editor/src/components/grid_custom_renderers/value_input_control.tsx
Outdated
Show resolved
Hide resolved
...ckages/private/kbn-index-editor/src/components/grid_custom_renderers/value_input_control.tsx
Outdated
Show resolved
Hide resolved
|
|
||
| export const StringInput: React.FC<ValueInputProps> = ({ onError, ...restOfProps }) => ( | ||
| <EuiFieldText compressed {...restOfProps} /> | ||
| export const StringInput = React.forwardRef<HTMLInputElement, ValueInputProps>( |
There was a problem hiding this comment.
did you consider using React.forwardRef in getInputComponentForType?
There was a problem hiding this comment.
Took the forwardRefs out, changed the implentation to use a focus trap as you suggested ❤️ 94c9364
src/platform/packages/shared/kbn-restorable-state/src/restorable_state_provider.tsx
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/kbn-restorable-state/src/restorable_state_provider.tsx
Show resolved
Hide resolved
| onInitialStateChange={onInitialStateChange} | ||
| > | ||
| <ComponentMemoized {...(props as TProps)} /> | ||
| {/* @ts-ignore */} |
There was a problem hiding this comment.
If you have no other options but using ts-ignore, we should also mentioned the suppressing error. But I wonder if you can make it work with generics?
|
I understand the intention to fix keyboard accessibility, but with that level of effort, I wonder if it might be better to address the issue on the EUI side instead? |
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM 👍
Nice idea on merging together the restorable state ref and the grid ref methods!
💔 Build Failed
Failed CI StepsMetrics [docs]
History
|
f9014f1
into
elastic:feature/lookup-join-ux
Part of #207330 >⚠️ Built on top of #229907, that needs to be merged first. ## Summary * Both for creating an index from scratch as well as editing the behaviour for adding a new row will be to push a new row in the grid in the first position. The focus will be changed to the first cell of the row, and if the user is in a different page than the first one, it will be directed to the first page. * For adding a new column, now the "Add field" button will push a new placeholder column into the grid (in the last position), if the new column is out of the viewport the grid will be auto scrolled until it's visible. * "Add row" button has been renamed as "Add document". * Added an illustration to the empty state. <img width="1726" height="874" alt="image" src="https://github.com/user-attachments/assets/0bbd3476-e4e2-4e16-9060-38f5955d6e0f" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Part of #207330
Summary
Improves the grid accessibility by:
dataGridref has been forwarded so it can be used forUnifiedDataTable, this ref exposes a method to programatically select the focused cell, it's used to keep the focus in the correct place after editing a cell.WithRestorableStateHOC now forwards the ref of the component it's wrapping. (Needed asUnifiedDataTableis wrapped with it.)dataGriddoes not expose a way to set focus on column headers, and does not allow to display popups on them. So making them keyboard navegable has been more tricky. It requires to set a data property in the html element that wraps the header and to manually put focus on it when required.Screen.Recording.2025-07-30.at.10.20.21.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.