Skip to content

Draft - #5186 eui range empty string override value - #5838

Closed
rc-enfuse wants to merge 3 commits into
elastic:mainfrom
enfuse:5186-EuiRange-empty-string-override-value
Closed

rc-enfuse wants to merge 3 commits into
elastic:mainfrom
enfuse:5186-EuiRange-empty-string-override-value

Conversation

@rc-enfuse

@rc-enfuse rc-enfuse commented Apr 22, 2022 •

Copy link
Copy Markdown

Summary

In my ticket there was a mismatch between the documentation and the actual behavior of the range control when the value input was blank. The ticket author also requested an enhancement to the control to allow for an override of the default behavior so they could specify the default location of the range handles when the input is blank.

I created a new prop for the range control that would change the location of the range handle when the input is blank. The range handle will still be bound by the range min/max values.

Behavior before my changes:

EuiRange_before_change

Behavior after my changes with slider default value set to 0

EuiRange_defaultValue_0

Behavior after my changes with slider default value set to 15

EuiRange_defaultValue_15

Checklist

  • Checked in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

… to override the default behavior of the range handles when the input value is blank.
@kibanamachine

Copy link
Copy Markdown
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service

cla-checker-service Bot commented Apr 22, 2022 •

Copy link
Copy Markdown

💚 CLA has been signed

@rc-enfuse rc-enfuse changed the title Draft - 5186 eui range empty string override value Draft - #5186 eui range empty string override value Apr 22, 2022
@rc-enfuse

Copy link
Copy Markdown
Author

Could use some help getting the documentation updated properly. I believe the text I wrote in the documentation should exist as text next to the prop and not as a paragraph in the doc. However I couldn't figure out how to add the text next to the props.

@chandlerprall

Copy link
Copy Markdown
Contributor

Thanks for opening this PR with the issue you encountered and proposing a resolution! This is definitely a state we can improve in the range slider.

I'm not sure we'd want to define a placeholder value for the thumb when the value is an empty string, and I'm interested in how your team decided on what value to put the thumb at in that case. I'm also curious if you considered about alternative approaches to represent this indeterminate state, such as greying out the handle or some other visual indication.

@rc-enfuse

Copy link
Copy Markdown
Author

Thanks for opening this PR with the issue you encountered and proposing a resolution! This is definitely a state we can improve in the range slider.

I'm not sure we'd want to define a placeholder value for the thumb when the value is an empty string, and I'm interested in how your team decided on what value to put the thumb at in that case. I'm also curious if you considered about alternative approaches to represent this indeterminate state, such as greying out the handle or some other visual indication.

I'm not that familiar with @dej611 use case. If the elastic team wants, I can remove the placeholder concept and just default the slider to the minimum range value. I was just providing a solution to the bug that was reported.

@andyrewwer

Copy link
Copy Markdown

Are there any updates on this?

@chandlerprall

Copy link
Copy Markdown
Contributor

Closing this as it's inactive and has no direction. I'm resuming the discussion in #5186 where other approaches can be explored.

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.

5 participants