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

Slider: input and change events not forwarded #31

Closed
2 tasks done
JVariance opened this issue Feb 19, 2022 · 4 comments
Closed
2 tasks done

Slider: input and change events not forwarded #31

JVariance opened this issue Feb 19, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@JVariance
Copy link

Before you start...

  • Have you updated your dependencies? You might be using an old version of the library.
  • Have you checked for an existing issue on this topic? If there is one, post a comment on it instead.

What browsers are you seeing the problem on?

Firefox, Chrome

Description

on:change and on:input event handlers on the Slider Component don't work.

See: https://svelte.dev/repl/833c79a8f04e497a80ed52ff2868978c?version=3.46.4

Steps To Reproduce

No response

Expected behavior

On:change and on:input events should be forwarded.

Relevant Assets

No response

@JVariance JVariance added the bug Something isn't working label Feb 19, 2022
@JVariance
Copy link
Author

For now I modified the Slider.svelte file with an reactive onChange(value) function as shown on https://graphcms.com/blog/data-binding-in-svelte.

@Tropix126
Copy link
Owner

Tropix126 commented Feb 19, 2022

Found the problem, events are forwarded to the outer <div> container. This is intentional, although I forgot to forward the input-specific events to the slider's <input> element. Should be an easy fix.

@Tropix126
Copy link
Owner

Tropix126 commented Feb 24, 2022

After further investigation it seems that <input> elements need to be modified via user interaction (vs programmatic value setting) for change and input events to be fired. I've pushed a fix that dispatches a custom change event for <Slider />. Closing as this will be fixed in the next publish.

@JVariance
Copy link
Author

JVariance commented Oct 4, 2022

@Tropix126 Unfortunately the event target and therefor the value aren't accessible in the CustomEvent returned from the Slider Component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants