-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiSelectable] Scrolls page when autoFocus
is set to true
#8287
Labels
Comments
1 task
nickofthyme
added a commit
to elastic/kibana
that referenced
this issue
Jan 27, 2025
## Summary Fixes an issue that caused the body scroll to jump when clicking options in the Lens inline editor flyout. Fixes #201544 This issue was created when we added the `autoFocus` option to the `EuiSelectable` for the dataview picker and the chart type picker. This appears to be an issue with how eui is handling the `autoFocus`, see elastic/eui#8287. In the meantime this is a workaround to prevent this scroll jumping while also keeping the auto focus behavior. https://github.com/user-attachments/assets/94256fa7-f6bd-4943-91f6-42201ce4ab74 ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release note Fixes and issue in Dashboards with the Lens inline editor where the dashboard would scroll to the top when interacting with the Lens editor flyout. --------- Co-authored-by: Marta Bondyra <[email protected]>
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Jan 27, 2025
…#207429) ## Summary Fixes an issue that caused the body scroll to jump when clicking options in the Lens inline editor flyout. Fixes elastic#201544 This issue was created when we added the `autoFocus` option to the `EuiSelectable` for the dataview picker and the chart type picker. This appears to be an issue with how eui is handling the `autoFocus`, see elastic/eui#8287. In the meantime this is a workaround to prevent this scroll jumping while also keeping the auto focus behavior. https://github.com/user-attachments/assets/94256fa7-f6bd-4943-91f6-42201ce4ab74 ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release note Fixes and issue in Dashboards with the Lens inline editor where the dashboard would scroll to the top when interacting with the Lens editor flyout. --------- Co-authored-by: Marta Bondyra <[email protected]> (cherry picked from commit a4089b1)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Jan 27, 2025
…#207429) ## Summary Fixes an issue that caused the body scroll to jump when clicking options in the Lens inline editor flyout. Fixes elastic#201544 This issue was created when we added the `autoFocus` option to the `EuiSelectable` for the dataview picker and the chart type picker. This appears to be an issue with how eui is handling the `autoFocus`, see elastic/eui#8287. In the meantime this is a workaround to prevent this scroll jumping while also keeping the auto focus behavior. https://github.com/user-attachments/assets/94256fa7-f6bd-4943-91f6-42201ce4ab74 ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release note Fixes and issue in Dashboards with the Lens inline editor where the dashboard would scroll to the top when interacting with the Lens editor flyout. --------- Co-authored-by: Marta Bondyra <[email protected]> (cherry picked from commit a4089b1)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Jan 27, 2025
…#207429) ## Summary Fixes an issue that caused the body scroll to jump when clicking options in the Lens inline editor flyout. Fixes elastic#201544 This issue was created when we added the `autoFocus` option to the `EuiSelectable` for the dataview picker and the chart type picker. This appears to be an issue with how eui is handling the `autoFocus`, see elastic/eui#8287. In the meantime this is a workaround to prevent this scroll jumping while also keeping the auto focus behavior. https://github.com/user-attachments/assets/94256fa7-f6bd-4943-91f6-42201ce4ab74 ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release note Fixes and issue in Dashboards with the Lens inline editor where the dashboard would scroll to the top when interacting with the Lens editor flyout. --------- Co-authored-by: Marta Bondyra <[email protected]> (cherry picked from commit a4089b1)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
When using
EuiSelectable
within anEuiPopover
in anEuiFlyout
inpush
mode when thebody
is set to scroll, enablingautoFocus
on thesearchProps
results in a jump in the parent scroll.Impact and severity
I would say this is a fairly common use case in kibana given the prevalent use of flyouts.
Related to elastic/kibana#201544
Environment and versions
latest
To Reproduce
Screenshots
Zight.Recording.2025-01-21.at.12.56.29.PM.mp4
Additional context
I was able to repro the issue in codesandbox here. Note you must have the preview environment width enough the enable the push mode of the flyout.
A workaround to this is to manually focus the
inputRef
like eui is doing internally. But set thepreventScroll
option to true.The strange thing is that the element is inside a nested scroll container (to flyout options) but is setting the scroll on the parent (body) element. I don't think it should care at all about the body scroll and maybe there is a way to prevent that while scrolling the closest scroll container. Maybe @elastic/eui-team knows more about why this is the case and has a better solution.
If no better ideas are voiced I think a we could simply allow
autoFocus
as aboolean
or anobject
of focus options where specifying options is the same astrue
but with modifications. So something like this...The text was updated successfully, but these errors were encountered: