Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support debounce option for inputs #2224

Merged

Conversation

PeterUstinox
Copy link
Contributor

@PeterUstinox PeterUstinox commented Sep 23, 2023

i would like to have control over the phx-debounce setting as a user for an input.

Right now it defaults to blur. I would expect an options same as Phoenix LiveView offers it

This is relevant for the inputs of type

  • range
  • textarea
  • password
  • date
  • number
  • color
  • url
  • text

each gets a :debounce option working the same as phoenix, but with a default value of "blur".

This change is accompanied by a change in Kino, see livebook-dev/kino#347

I chose to add a fallback to "blur" here as well, so there is no hard dependency on the Kino change:
@attrs[:debounce] || "blur"

This was a show stopper for me, when i tried to create a little type racing game in Livebook.

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

github-actions bot commented Sep 26, 2023

Uffizzi Preview deployment-36818 was deleted.

@jonatanklosko jonatanklosko changed the title add debounce option for inputs Support debounce option for inputs Sep 26, 2023
@jonatanklosko jonatanklosko merged commit edc09cd into livebook-dev:main Sep 26, 2023
7 checks passed
@PeterUstinox PeterUstinox deleted the add-debounce-option-for-inputs branch October 5, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants