Focus is stolen from input and textarea elements in void nodes
See original GitHub issueDo you want to request a feature or report a bug?
bug
What’s the current behavior?
Focus from input
and textarea
controls have their focus stolen when clicked, even though they are rendered as void nodes. If the controls are tabbed into, the focus remains.
May be a regression of this issue: https://github.com/ianstormtaylor/slate/issues/1744
JSFiddle: https://jsfiddle.net/rfeltis/fj9dvhom/2742/
OS: macOS Mojave 10.41.1 Browser: Chrome 71.0.3578.98 and Firefox 64.0
What’s the expected behavior?
The focus stays inside of the input
and textarea
fields.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Focus is stolen from input and textarea elements in void nodes
Focus from input and textarea controls have their focus stolen when clicked, even though they are rendered as void nodes. If the controls...
Read more >Prevent input box from stealing focus - javascript
Is there any way to disable all "focus stealing"-scripts and turn them on again after my work is done? (I know the class...
Read more >Remove focus javascript. It sets the element as an active ...
Let's focus the input tag element using focus() method like this, ... remove keyboard focus from a form element — DOM Level 2...
Read more >https://unpkg.com/office-ui-fabric-react@7.14.0/di...
FocusEvent<HTMLElement | Autofill>) => void; /** * Reveals suggestions any time the user clicks on the input element * without shifting focus.
Read more >Silverlight Techniques for WCAG 2.0
The user navigates elements in the Silverlight application area, ... handles the Silverlight input event and uses that event as stimulus to call...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe the problem is in the onMouseDown branch here: https://github.com/ianstormtaylor/slate/blob/13107b0c437fe0e84231c87f6e7887f6defc08c8/packages/slate-react/src/plugins/after.js#L390-L398
@nicoxx As a workaround, we added
preventDefault/stopPropagation
to the click handler of our inputs. Fixes it for the time being.