solop
Why are phx-keydown / keyup "not supported" for input
Hi ![]()
I am working on an input in a form with a custom autocomplete dropdown. I would like to realize it without a lot (or any) JS. I managed to create a working component, using phx-keydown events on the input. When keys like arrows, enter etc are pressed the autocomplete element is updated or the selected suggestion applied.
I am quite confused why it says in the docs that phx-keydown is not supported on inputs. The alternatives, installing a key listener on the window etc won’t work because I need to know in which element the keypresses originated. The other suggestion, to use phx-change also can’t support a UI like this, because I will get events when the content of the input changes but not when the user presses some arrow keys.
Does anyone know what “not supported” means here and why?
First Post!
solop
Tagging @josevalim because you added this note to the docs ( Improve container and phx-key docs · phoenixframework/phoenix_live_view@d485326 · GitHub )
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








