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

Discussion about the behavior when initializing with an empty value #118

Open
diesl opened this issue Aug 24, 2020 · 6 comments
Open

Discussion about the behavior when initializing with an empty value #118

diesl opened this issue Aug 24, 2020 · 6 comments

Comments

@diesl
Copy link
Contributor

diesl commented Aug 24, 2020

The documentation on the website is outdated. Could you please update it?

At least all Settings and Events should be documented, adding more examples is not absolutely necessary.

Also, the used version of the touchspin library should be updated, it uses v3.0.1 from 28 May 2014 ...

@diesl
Copy link
Contributor Author

diesl commented Oct 8, 2021

@istvan-ujjmeszaros One year has passed without any response. Is this project dead?

@istvan-ujjmeszaros istvan-ujjmeszaros changed the title Update website and documentation Discussion about the behavior when initializing with an empty value Apr 7, 2023
@istvan-ujjmeszaros
Copy link
Owner

istvan-ujjmeszaros commented Apr 7, 2023

@diesl good points under #106. I would be happy to improve the behavior, maybe by adding a new configuration parameter to set the behavior, defaulting to use the min value. But, on the other hand, I don't see a good use case to initialize the plugin with an empty value so I am just guessing what would be a suitable solution for everyone.
These possibilities came to my mind:

  • min_or_max: Use the minimum value when the "+" button is clicked and the maximum value when the "-" button is clicked
  • min: Always use the minimum value when either button is clicked
  • max: Always use the maximum value when either button is clicked
  • midpoint: Always use the midpoint value when either button is clicked

If we default to midpoint then we can avoid a new breaking change and just have to update the documentation. What do you guys think?

Also, I am not sure what to do when only one or the other (meaning the min and max values) was being set.

@istvan-ujjmeszaros
Copy link
Owner

Just to note, the up and down buttons, the keyboard up/down arrows, and the mousewheel are all behaving consistent since the latest fixes are done (there are tests to make sure they all behave the same), so the behavior will be consistent across all methods of input.

@diesl
Copy link
Contributor Author

diesl commented Apr 8, 2023

Thanks for picking this up again. Yes, I think it is a good idea to make this more flexible.

But, on the other hand, I don't see a good use case to initialize the plugin with an empty value

Not sure what exacltly you mean here.

These possibilities came to my mind:

Additionally, I would suggest the following:

  • a number (I think this is already implemented)
  • a function (to let the user create his own init value)

I still think midpoint is fairly exotic and could be solved with a custom function, but of course this would be a breaking change again. Could be done with a major version number change though.

Also, I am not sure what to do when only one or the other (meaning the min and max values) was being set.

I case of midpoint, you can not compute it. Fall back to existing min or max. If both are not set, fall back to 0.

@diesl
Copy link
Contributor Author

diesl commented Apr 8, 2023

I also wanted to note that this ticket originally was far more general and not focused on one particular setting:

The documentation on the website is outdated. Could you please update it?
At least all Settings and Events should be documented, adding more examples is not absolutely necessary.
Also, the used version of the touchspin library should be updated, it uses v3.0.1 from 28 May 2014 ...

@istvan-ujjmeszaros
Copy link
Owner

I think that the settings and the events should be added to README.md too as this is quite obvious to update it when a new setting is being added. I will update the website too, but I am still thinking about what is the best way to do it (trying to come up with an automated way to populate the website with the latest version automagically - but I will update it manually in the next couple days). I have created #153 to be sure not to forget it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants