Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Converted `EuiOverlayMask` to be a React functional component ([#3555](https://github.com/elastic/eui/pull/3555))
- Changed `responsive` and `max` behavior of `EuiBreadcrumbs` to always display collapsed items in popover [#3578](https://github.com/elastic/eui/pull/3578))
- Added `BREAKPOINTS` and `getBreakpoint` utilities [#3578](https://github.com/elastic/eui/pull/3578))
- Added `'any'` option to the `step` prop of the `EuiFieldNumber` ([#3562](https://github.com/elastic/eui/pull/3562))

**Bug fixes**

Expand Down
3 changes: 1 addition & 2 deletions src-docs/src/views/form_controls/field_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ export default () => {
const [value, setValue] = useState('');

const onChange = e => {
const sanitizedValue = parseInt(e.target.value, 10);
setValue(isNaN(sanitizedValue) ? '' : sanitizedValue);
setValue(e.target.value);
};

return (
Expand Down
7 changes: 6 additions & 1 deletion src/components/form/field_number/field_number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ export type EuiFieldNumberProps = InputHTMLAttributes<HTMLInputElement> &
readOnly?: boolean;
min?: number;
max?: number;
step?: number;
/**
* Specifies the granularity that the value must adhere to.
* Accepts a `number` or the string `'any'` for no stepping to allow for any value.
* Defaults to `1`
*/
step?: number | 'any';
inputRef?: Ref<HTMLInputElement>;

/**
Expand Down