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

Account for min attribute when determining EuiRange input width #1406

Merged
merged 3 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

- Change `EuiListGroup` PropType for `extraAction` to clearn warning ([#1405](hhttps://github.com/elastic/eui/pull/1405))


**Bug fixes**

- Account for `min` attribute when determining `EuiRange` input width ([#1406](https://github.com/elastic/eui/pull/1406))

## [`6.1.0`](https://github.com/elastic/eui/tree/v6.1.0)

- Added `EuiListGroup` and `EuiListGroupItem` components ([#1377](https://github.com/elastic/eui/pull/1377))
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/range/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class EuiRange extends Component {
let extraInputNode;
if (showInput) {
// Chrome will properly size the input based on the max value, but FF & IE does not.
// Calculate the max-width of the input based on number of characters in max unit
// Calculate the max-width of the input based on number of characters in min or max unit, whichever is greater.
// Add 2 to accomodate for input stepper
const maxWidthStyle = { maxWidth: `${String(max).length + 2}em` };
const maxWidthStyle = { maxWidth: `${Math.max(String(min).length, String(max).length) + 2}em` };

// Make this input the main control by disabling screen reader access to slider control
sliderTabIndex = '-1';
Expand Down