-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
[BasicUI] Fix slider behaviour and implement two different modes #2535
Conversation
651099e
to
215b026
Compare
Fix openhab#2525 Also related to openhab/openhab-core#4084 and openhab/openhab-core#3430 Two behaviour modes are now supported. - If releaseOnly parameter is set, the new value is sent to the item only when the slider is released. - If releaseOnly parameter is not set, new values are sent to the item while moving the slider. Events are sent at a certain frequency, this frequency is defined by the sendFrequency parameter if set or every 200 ms by default. Event is not sent when the value is is unchanged (when stopping the move but keeping the mouse pressed). The brightness slider of the colorpicker widget is also updated to send regular new color commands when moving the slider. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Change tested with success using Firefox, Chrome and Edge on Windows 10 and using Chrome on an Android phone. Note that the previous implementation tries to handle browsers not respecting the standard* but with problems with all browsers respecting this standard. *Expected behaviour for a browser is to trigger "input" events when the slider is moving but not "change" events. "change" event should be triggered only when the slider is finally released. I read that 10 years ago, browsers like Internet Explorer were triggering "change" events while the slider was moving. |
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Keep a hardcoded interval of 200ms Signed-off-by: Laurent Garnier <lg.hc@free.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Follow up openhab#2535 The function reloadIcon is already called by the function setValue at line 636 just before calling setValuePrivate. The icon continues being refreshed while moiving the slider except if releaseOnly parameter is set. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Follow up openhab#2535 The function reloadIcon is already called by the function setValue at line 636 just before calling setValuePrivate. The icon continues being refreshed while moving the slider except if releaseOnly parameter is set. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Fix #2525
Also related to openhab/openhab-core#4084 and openhab/openhab-core#3430
Two behaviour modes are now supported.
The brightness slider of the colorpicker widget is also updated to send regular new color commands when moving the slider.
Signed-off-by: Laurent Garnier lg.hc@free.fr