marcandre
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.
Trending in Proposals: Ideas
I’m a bit in a fuzz about this topic. I’ve worked out some sort of Dropbox feature for a specific client. This feature allows him to uplo...
New
Other Trending Topics
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
Does
phx-changework?marcandre
No,
inputis triggered for every changes, before they are “committed”, whilechangeis triggered when it’s committed (e.g. you tab out the text field). That’s why I compared it tokeyup; you might get a bunch ofkeyupbefore there’s achangeevent.Another example, the color input presents a modal with a color wheel. It triggers
inputevents whenever you select a color, andchangeonly when you click on “ok”.chrismccord
phx-changeon a form or input is effectively theinputlistener. (We literally bind to"input"), so phx-change should give you what you want.marcandre
Note that I couldn’t find this information anywhere in the doc.
Please consider renaming the hook
phx-inputas it is literally what it does. Looking at the source, there’s binding on both “input” and “change”, with de-dupping that should actually never use the “change” binding, unless the user triggers manually a “change” event without an “input” event to precede it (in which case the next “input” event will actually be wrongly ignored by phoenix)marcandre
I believe this PR fixes the potential minor issue I was mentioning.
magiclouie
I am with you.
Your observation about renaming the
phx-changetophx-inputmakes sense, considering the underlying binding to the “input” event. It would also provide clarity and consistency for developers when reading the code and documentation.