From 7da5d75f18550ff4010e97a8fa875e86d4c66d33 Mon Sep 17 00:00:00 2001 From: Casey Zumwalt Date: Fri, 4 Jan 2019 13:15:53 -0800 Subject: [PATCH 1/3] Account for min attribute when determining EuiRange input width --- src/components/form/range/range.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/form/range/range.js b/src/components/form/range/range.js index 876ee7c2e63..72dbe45d93f 100644 --- a/src/components/form/range/range.js +++ b/src/components/form/range/range.js @@ -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'; From 42c995a113faac69c694b33ee45cfa56f03ddf5d Mon Sep 17 00:00:00 2001 From: Casey Zumwalt Date: Fri, 4 Jan 2019 13:20:36 -0800 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afcad8fe4b3..a661cd06c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Account for `min` attribute when determining `EuiRange` input width ([#1406](https://github.com/elastic/eui/pull/1406)) - Change `EuiListGroup` PropType for `extraAction` to clearn warning ([#1405](hhttps://github.com/elastic/eui/pull/1405)) ## [`6.1.0`](https://github.com/elastic/eui/tree/v6.1.0) From c22c45a87b9be8236bfccb4aeb569109b080a86a Mon Sep 17 00:00:00 2001 From: Casey Zumwalt Date: Fri, 4 Jan 2019 13:38:53 -0800 Subject: [PATCH 3/3] Bug fix heading in the changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a661cd06c29..87c858925a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -- Account for `min` attribute when determining `EuiRange` input width ([#1406](https://github.com/elastic/eui/pull/1406)) - 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))