Skip to content
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

Form inputs not always receiving focus on mouse click #3756

Closed
peteharverson opened this issue Jul 16, 2020 · 4 comments
Closed

Form inputs not always receiving focus on mouse click #3756

peteharverson opened this issue Jul 16, 2020 · 4 comments
Assignees
Labels

Comments

@peteharverson
Copy link

EUI form inputs sometimes are not receiving focus on mouse click.

For example, on opening this flyout in the ML Anomaly Explorer page, clicking on the EuiTextArea is not giving it focus:

textinput_focus

Have also seen this happen on inputs inside Kibana Dashboard, such as the inputs in the date picker, and on the Index Patterns page inside Stack Management. The only way to get focus is to use the keyboard to TAB into the input.

Found on Kibana with EUI v26.3.1.

@chandlerprall
Copy link
Contributor

chandlerprall commented Jul 16, 2020

I've replicated in the anomaly explorer page on Kibana master branch. Digging into the cause now.

Specifically: if I view a job in the single metric viewer and then switch to the Anomaly Explorer, the Annotations search box is never focusable. Also of interest: if I tab to that search box so it has focus, I cannot shift focus away from it by clicking on the page body.

Reproducible in Chrome, FF, Safari, and Edge on MacOS

Observerations/Findings

  • No observed any calls to HTMLElement.prototype.focus, which may be used prevent the operation
  • Added event listeners to document.body for click and mousedown events, both successfully bubble up with the expected target input field - browsers apply focus changes between these two events
  • As described, tabbing still works; this does not appear to be related to any focus trapping
  • Click on the input's Clear button properly clears the input and focuses on the element, typing works, but cannot click to a non-interactive element (e.g. the page body) to de-select, have to tab out of the element. After this, clicking remains in-operable.
  • Sometimes the element will become available again, once it does it remains
  • Switching to another tab and immediately back appears to "resolve" the issue (in Chrome at least, in FF it seems I need to resize the window to be able to scroll the element out of view, and that works ~10% of the time.) Seems somewhat viewport related?

@chandlerprall chandlerprall self-assigned this Jul 16, 2020
@chandlerprall
Copy link
Contributor

@peteharverson I see something happening with the ml-swimlane-selector that may be related. It appears that opening the anomaly explorer adds 2 or 4 of these elements and never removes them, and they're doing something in response to mouse clicks on the page. Can you or someone on ML take a look into that?

anomaly explorer adding ml-swimlane-selector elements

@darnautov
Copy link

hey @chandlerprall, thanks for spotting this, the fix is coming

@darnautov
Copy link

darnautov commented Jul 17, 2020

The issue fixed by elastic/kibana#72250, sorry for bothering! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants