From fcf270350c0fec5a8d19582f32fd6fd02bbde9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 00:21:34 +0100 Subject: [PATCH 1/6] [EuiFieldNumber] Add `string` as valid value type --- src/components/form/field_number/field_number.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/field_number/field_number.tsx b/src/components/form/field_number/field_number.tsx index a5ceefc4280..9d0ca0dc2d3 100644 --- a/src/components/form/field_number/field_number.tsx +++ b/src/components/form/field_number/field_number.tsx @@ -13,7 +13,7 @@ import { IconType } from '../../icon'; export type EuiFieldNumberProps = InputHTMLAttributes & CommonProps & { - value?: number | ''; + value?: string | number; icon?: IconType; isInvalid?: boolean; fullWidth?: boolean; From dae3cbdca3ca6f926a9c322cfba0903156f8b3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 19:34:00 +0100 Subject: [PATCH 2/6] Update src/components/form/field_number/field_number.tsx Co-Authored-By: Dimitri Mitropoulos --- src/components/form/field_number/field_number.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/field_number/field_number.tsx b/src/components/form/field_number/field_number.tsx index 9d0ca0dc2d3..6215c50fefe 100644 --- a/src/components/form/field_number/field_number.tsx +++ b/src/components/form/field_number/field_number.tsx @@ -13,7 +13,7 @@ import { IconType } from '../../icon'; export type EuiFieldNumberProps = InputHTMLAttributes & CommonProps & { - value?: string | number; + value?: InputHTMLAttributes['value']; icon?: IconType; isInvalid?: boolean; fullWidth?: boolean; From bcd9a7f02a3a385671c1bad4df3b08b1734d412c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 19:37:10 +0100 Subject: [PATCH 3/6] Don't override `value` with custom type (use default from `InputHTMLAttributes`) --- src/components/form/field_number/field_number.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/form/field_number/field_number.tsx b/src/components/form/field_number/field_number.tsx index 6215c50fefe..fa7938eeaa0 100644 --- a/src/components/form/field_number/field_number.tsx +++ b/src/components/form/field_number/field_number.tsx @@ -13,7 +13,6 @@ import { IconType } from '../../icon'; export type EuiFieldNumberProps = InputHTMLAttributes & CommonProps & { - value?: InputHTMLAttributes['value']; icon?: IconType; isInvalid?: boolean; fullWidth?: boolean; From 686f3f18e8acfd3370ca45452890058fa69af6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 21:47:11 +0100 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04ca018c2f7..c3833e078c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Allow value of type string in `EuiFieldNumber` component ([#3020](https://github.com/elastic/eui/pull/3020)) - Added `EuiDataGrid`'s default sort order property ([#2987](https://github.com/elastic/eui/pull/2987)) - Fixed `EuiDataGrid`'s pagination visibility when changing rows per page ([#2978](https://github.com/elastic/eui/pull/2978)) - Added `highlightAll` prop to `EuiHighlight` to highlight all matches ([#2957](https://github.com/elastic/eui/pull/2957)) From 00ae420742bb4629fbdeaea416eb9fb239c7cee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 21:48:22 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b47d05884c..c6e94cf702c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Allow value of type string in `EuiFieldNumber` component ([#3020](https://github.com/elastic/eui/pull/3020)) ## [`21.0.0`](https://github.com/elastic/eui/tree/v21.0.0) + - Added `EuiDataGrid`'s default sort order property ([#2987](https://github.com/elastic/eui/pull/2987)) - Fixed `EuiDataGrid`'s pagination visibility when changing rows per page ([#2978](https://github.com/elastic/eui/pull/2978)) - Added `highlightAll` prop to `EuiHighlight` to highlight all matches ([#2957](https://github.com/elastic/eui/pull/2957)) From 183d2c92f7fc1191d3ba1a93e8ce0fcecdb436ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 10 Mar 2020 21:51:00 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6e94cf702c..af851569c83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -- Allow value of type string in `EuiFieldNumber` component ([#3020](https://github.com/elastic/eui/pull/3020)) +**Bug Fixes** + +- Fixed `EuiFieldNumber` so values of type `number` are now allowed ([#3020](https://github.com/elastic/eui/pull/3020)) ## [`21.0.0`](https://github.com/elastic/eui/tree/v21.0.0)