behe
I have created a list with items inn LiveView which when an item is clicked is rerendered as an input field. Is there a callback or similar that I can hook into to also be able to put text input focus on the selected input field?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
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
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
chrismccord
Add
autofocusto the input taghurty
The
autofocusattribute doesn’t seem sufficient in practice. The behaviour is not the same across all browsers. Can I use... Support tables for HTML5, CSS3, etc says it doesn’t work with iOS Safari.I’ve updated the table editor demo with an
autofocusattribute that should resemble @behe use case : https://liveview.cleverapps.io/tablesbehe
This only seems to works once. The next input will unfortunately not receive focus.
sribe
Changing an input type, or enabling, or adding it, then giving it focus is just one of those things that GUI libs worked out in the 1980s, but that web browsers still screw up royally. If you were to take the time to try, you’d find that you cannot do this reliably in straight browser-side Javascript. The closest you can come is to set a timer to fire to set focus after you’ve done the other stuff, and even then it’s iffy.
maz
And this is the REAL reason why the Native vs. Web war never ends.
jsteiner
Similar question: I’d like to scroll to a newly added element. Basically Add dynamic inputs_for example · chrismccord/phoenix_live_view_example@1181c79 · GitHub, but the new element may be out of view so I want to move it into the viewport.
Sounds like maybe there are no client side callbacks available? Any plans/thoughts on supporting something like that?
Owens
I have the same need, but decided to just let the item be a text input instead of click and turn it into a text input. If needed you can style the input so when it’s not focused it doesn’t look like an input, then when you focus it, the style changes and it looks like an input.
behe
Found this nice workaround: Using Channels with LiveView for Better UX | Blog · Elixir School
behe
This can now be solved with a phx-hook: Phoenix.LiveView — Phoenix LiveView v1.2.5
ibarch
The following solution works for me.
Create AutoFocus hook in
./assets/js/app.jsAttach it to the first input field of a form