Skip to content

[EuiRange] It should be possible to express a fallback value for empty string invalid state #5186

Closed as not planned

Description

@dej611

We have a use case where the empty string is mapped to the last valid value in the range input.

Right now the range slider is moved in the middle of the single range bar, but it would be useful to avoid the movement of the slider in this specific case.

Activity

  1. github-actions commented on Mar 14, 2022

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  2. added
    stale-issue
    on Mar 14, 2022
  3. cchaos commented on Mar 14, 2022

    @cchaos
    Contributor

    @dej611 I'm not understanding your use-case. EuiRange requires passing a value so it knows where to place the handle along the slider. Without a value the range slider is incomplete/invalid. It sounds more like you should be evaluating on the implementation side before passing back in the value to the slider.

    I can see in our own documentation we don't actually align with our explanation when withInput = true. You can see the handle shift to the middle when deleting the value before typing in a new one, though our docs say it should shift to the min value. We should probably fix this, but it still means that the handle will change position when the value="". I also wonder if this is truly a valid state.

    Screen Recording 2022-03-14 at 12 37 52 PM

    I'll mark this as a bug fix to align with our documented explanation. But if there's more you need, please explain further. (Screenshots would help).

  4. added and removed
    stale-issue
    on Mar 14, 2022
  5. dej611 commented on Mar 16, 2022

    @dej611
    ContributorAuthor

    @dej611 I'm not understanding your use-case. EuiRange requires passing a value so it knows where to place the handle along the slider. Without a value the range slider is incomplete/invalid. It sounds more like you should be evaluating on the implementation side before passing back in the value to the slider.

    I think we agree that an empty string is an invalid state for the slider.
    Right now the only way to move the slider handler is to set a value, which is reflected in the input box there. We were looking for some sort of placeholder behaviour in this case where a custom value is provided to the slider, and when set this value is used to place the slider handle in such position, without filling the input box (hence keeping the empty string).

    As possible use case is the following:

    • the user opens the panel with the slider set to 60 (in a 0-100 range)
    • the user deletes 0 and the slider move to 6
    • the user deletes 6 and the slider moves back to 60 (the placeholder value, which in our case was the initial value)
    • the user types 20 at this point and the slider handle moves to the right place

    Right now this is not possible there's a two way binding between the input box and the slider position.
    I think that this is more an enhancement request rather than a bug.

  6. rc-enfuse commented on Apr 21, 2022

    @rc-enfuse

    Team,
    Could you please assign this bug to me?

  7. rc-enfuse commented on Apr 22, 2022

    @rc-enfuse

    @dej611 Does this change meet your expectations? I think I'm in the ballpark of what your looking for
    elastic/eui/pull/5838

  8. thompsongl commented on Apr 25, 2022

    @thompsongl
    Contributor

    EUI does not do any work to shift the handle to the middle of the range in the undefined/empty value case; this is part of the DOM spec. As much as possible we've deferred to native HTML behavior and this is one of those cases.

  9. chandlerprall commented on Jun 20, 2022

    @chandlerprall
    Contributor

    As said above, EUI follows the spec here where an undefined value is rendered in the middle of the range.

    However, there is room for a distinction between an actual undefined value vs. the user has cleared the range input but it is still focused for new input. I think it makes sense in that case to preserve the thumb's location until the value updates or the blur event fires.

  10. added
    help wanted
    on Jan 30, 2023
  11. added
    Stale
    on Oct 4, 2024
  12. removed
    Stale
    on Oct 14, 2024
  13. github-actions commented on Sep 22, 2025

    @github-actions

    👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

  14. added
    stale-issue
    on Sep 22, 2025
  15. JasonStoltz commented on Dec 15, 2025

    @JasonStoltz
    Contributor

    Closing this old issue as it has gone stale. Feel free to re-open it if you feel it is still important.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuehelp wantedstale-issue

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions