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] onChange ran when initialized #1000

Closed
y0hami opened this issue Sep 5, 2019 · 2 comments
Closed

[Slider] onChange ran when initialized #1000

y0hami opened this issue Sep 5, 2019 · 2 comments
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@y0hami
Copy link
Member

y0hami commented Sep 5, 2019

Bug Report

Steps to reproduce

  1. Create a slider with onChange method
  2. View the page

Expected result

Nothing should happen in the onChange method and the slider should be initialized as normal

Actual result

Slider is initialized but onChange is ran

Testcase

https://jsfiddle.net/jgwkd75c/

Screenshot

asbYBqd5Eu

Version

2.7.8

@y0hami
Copy link
Member Author

y0hami commented Sep 5, 2019

This is because set.value() is ran in the read.settings() method here https://github.com/fomantic/Fomantic-UI/blob/develop/src/definitions/modules/slider.js#L1002

and read.settings() is ran in the initialize method here https://github.com/fomantic/Fomantic-UI/blob/develop/src/definitions/modules/slider.js#L112

@y0hami y0hami added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript labels Sep 5, 2019
@y0hami y0hami added this to the 2.8.0 milestone Sep 5, 2019
@GammaGames
Copy link
Contributor

I always assumed this was a feature, dropdown does it too. I do see that a few other modules have a fireOnInit setting, but I'm not sure if it's working on the Rating module. https://jsfiddle.net/x8ue7dmq/

I think not calling onChange by default and offering a fireOnInit for every input would be the most consistent.

@lubber-de lubber-de added the state/has-pr An issue which has a related PR open label Sep 30, 2019
@y0hami y0hami added tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build and removed state/has-pr An issue which has a related PR open labels Oct 18, 2019
@y0hami y0hami closed this as completed in c629516 Nov 14, 2019
@y0hami y0hami removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants