filament
filament copied to clipboard
Keybindings only work first time after page load
Package
filament/filament
Package Version
v3.x
Laravel Version
v10.x
Livewire Version
v3.x
PHP Version
PHP 8.x
Problem description
A defined key binding only works the first time after a page load. Then no action is fired.
This is the only related topic I could find: https://github.com/filamentphp/filament/discussions/3970
Expected behavior
I expect the action to fire every time I press the key combination.
Steps to reproduce
- Go to https://demo.filamentphp.com/shop/products/1/edit
- Press
CTRL+S
/CMD+S
and see the page save - Try again, and it does not work until the page is fully refreshed
Reproduction repository
https://github.com/filamentphp/demo
Relevant log output
No response
Related warning:
Form submission canceled because the form is not connected
h @ app.js?v=3.0.63.0:1
(anonymous) @ app.js?v=3.0.63.0:1
x @ app.js?v=3.0.63.0:1
t._handleKey @ app.js?v=3.0.63.0:1
v.handleKey @ app.js?v=3.0.63.0:1
G @ app.js?v=3.0.63.0:1
More info: If the text cursor is placed in the Name field (or any other input
field) on the demo product and you press enter — submitting the form like usual — it works every time.
Was just about to complain and suggest this was a problem with the Alpine Mousetrap plugin, then realised I was the one who built it, whoops
This actually breaks after any Livewire request, not just the first time the keybinding is used
Has anyone been able to find a workaround for this? Still seems to be happening.
@danharrin if you know, mind sharing what that bug was in alpine mousetrap? that will save us from investigating and get a headstart in solving the problem.
I don't know what the bug is, that will need to be investigated by whoever decides to pursuit a fix
Alright thanks, let me find some bandwidth to deal with it.
I don't think this is a dependency issue; it's more related to browser behavior. As a quick solution, we can use a click event. Check #12672, please
thanks!
@dmitry-udod
My form has a filament markdown editor
- If I click the form submit button using mouse, it correctly clears its own content
- But if I press ctrl+enter, it does not clear its content
Do you face this issue?
I filed https://github.com/filamentphp/filament/issues/12858 for MDE not clearing it's contents when submitting via keyboard