From a3a5ebde008473508bdfbcbf2a50307f9f06fa68 Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Wed, 13 Apr 2022 16:17:10 -0500 Subject: [PATCH 1/2] feat(slider): add onKeyUp callback prop for input --- packages/react/src/components/Slider/Slider.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react/src/components/Slider/Slider.js b/packages/react/src/components/Slider/Slider.js index 7fd35e7fcc2b..4e4c79788431 100644 --- a/packages/react/src/components/Slider/Slider.js +++ b/packages/react/src/components/Slider/Slider.js @@ -127,6 +127,11 @@ export default class Slider extends PureComponent { */ onChange: PropTypes.func, + /** + * Provide an optional function to be called when a key is pressed in the number input + */ + onInputKeyUp: PropTypes.func, + /** * The callback to get notified of value on handle release. */ @@ -653,6 +658,7 @@ export default class Slider extends PureComponent { step={step} onChange={this.onChange} onBlur={this.onBlur} + onKeyUp={this.onInputKeyUp} data-invalid={isValid ? null : true} aria-invalid={isValid ? null : true} /> From fed01ca8aa86edda6157239bb9941875efa1e0de Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Wed, 13 Apr 2022 16:17:24 -0500 Subject: [PATCH 2/2] feat(numberinput): add onKeyUp callback prop for input --- .../react/src/components/NumberInput/next/NumberInput.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react/src/components/NumberInput/next/NumberInput.js b/packages/react/src/components/NumberInput/next/NumberInput.js index a1a143785a8f..7e849067fc54 100644 --- a/packages/react/src/components/NumberInput/next/NumberInput.js +++ b/packages/react/src/components/NumberInput/next/NumberInput.js @@ -45,6 +45,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, forwardRef) { min, onChange, onClick, + onKeyUp, readOnly, size = 'md', step = 1, @@ -162,6 +163,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, forwardRef) { min={min} onClick={onClick} onChange={handleOnChange} + onKeyUp={onKeyUp} pattern="[0-9]*" readOnly={readOnly} step={step} @@ -329,6 +331,11 @@ NumberInput.propTypes = { */ onClick: PropTypes.func, + /** + * Provide an optional function to be called when a key is pressed in the number input + */ + onKeyUp: PropTypes.func, + /** * Specify if the component should be read-only */