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 text field #1492

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Slider text field #1492

wants to merge 11 commits into from

Conversation

cgjgh
Copy link
Contributor

@cgjgh cgjgh commented Nov 22, 2024

Description

Adds an optional text field for number input next to slider.

Screen.Recording.2024-11-21.214316.mp4

Related Issue(s)

Closes #1063

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

@cgjgh cgjgh marked this pull request as draft November 22, 2024 03:58
@joepavitt joepavitt self-requested a review November 22, 2024 16:41
@joepavitt
Copy link
Collaborator

Seeing 2 x E2E failures in the slider.spec.js that'll need reviewing please @cgjgh - otherwise, this is an excellent addition

@cgjgh cgjgh marked this pull request as ready for review November 22, 2024 20:19
Copy link
Collaborator

@joepavitt joepavitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks as always @cgjgh - another great addition, although, whilst it does bind well with the slider when changing from the slider side, two issues spotted when changing the value directly in the text input:

  • It doesn't emit an event back into Node-RED when only changing the text field
  • If you have steps in place, e.g. 0-10 with steps of 2, and you put in a number that isn't valid because the steps, but is valid because of the range - the slider will update correctly, but the text-field doesn't correct itself

I think you may need to bind the text-field to a different model value, then handle the events accordingly.

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.

UI Slider - Text Field Input
2 participants