Editable submitOnBlur submits on button click
See original GitHub issue🐛 Bug report
Following the example from https://chakra-ui.com/docs/form/editable#with-custom-controls
I would expect it to behave the same with submitOnBlur
, i.e., <kbd>esc</kbd> should undo any change instead of calling onSubmit
. Also, the cancel button should call onCancel
instead of onSubmit
.
💥 Steps to reproduce
The example linked below first calls onCancel
and afterwards onSubmit
but does not revert changes.
If you click the cancel button, it only calls onSubmit
. I understand that clicking the button does blur EditableInput
, but maybe the blur should be scoped to Editable
instead. How can I get the button to call onCancel
otherwise?
💻 Link to reproduction
TypeScript CodeSandbox template
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | 1.1.5 |
Browser | Chrome 87.0.4280.88 |
Operating System | macOS 11.1 (20C69) |
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
X-Editable set onblur: "submit" as a default behavior
Is there a convenient way to set for all my usages of the editable function - onblur to be 'submit' and not 'cancel'...
Read more >onBlur: 'submit' — DataTables forums
I have always had problems with inline editing and submitting values "onBlur". It worked but in some cases it didn't work.
Read more >onblur Event - W3Schools
The onblur event occurs when an element loses focus. The onblur event is often used on input fields. The onblur event is often...
Read more >Element: blur event - Web APIs | MDN
There are two ways of implementing event delegation for this event: by using the focusout event, or by setting the useCapture parameter of ......
Read more >lightning-input - documentation - Salesforce Developers
Use lightning-button instead for input types button , reset , and submit . ... validated against the user's Salesforce locale format during the...
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
Looking into this!
Sorry, added above. Your setup behaves differently?