marcandre
Add `phx-input` binding to LiveView
I notice that most events have bindings (e.g. phx-keyup) but not the input event.
The input event is the preferred way to interact with an input. For a text input, the keyup and input events will typically correspond, but not always. Example: pressing arrow keys, or command-A triggers keyup but no input. Selecting the “Cut” or “Paste” menu items will generate an input even but no keyup.
Most Liked
chrismccord
phx-change on a form or input is effectively the input listener. (We literally bind to "input"), so phx-change should give you what you want.
LostKobrakai
Does phx-change work?
marcandre
No, input is triggered for every changes, before they are “committed”, while change is triggered when it’s committed (e.g. you tab out the text field). That’s why I compared it to keyup; you might get a bunch of keyup before there’s a change event.
Another example, the color input presents a modal with a color wheel. It triggers input events whenever you select a color, and change only when you click on “ok”.
Popular in Proposals: Ideas
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
- #javascript
- #code-sync
- #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








