diff --git a/packages/dnb-design-system-portal/src/docs/uilib/components/input/demos.mdx b/packages/dnb-design-system-portal/src/docs/uilib/components/input/demos.mdx index 24e408fa5a1..759c9f8cbe6 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/components/input/demos.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/components/input/demos.mdx @@ -68,7 +68,7 @@ Pressing the enter key will trigger a submit. ### Input with clear button -Pushing the clear button or pressing the ESC key will clear the input. +Pushing the clear button will clear the input. diff --git a/packages/dnb-eufemia/src/components/input/Input.js b/packages/dnb-eufemia/src/components/input/Input.js index b689720bb27..a457df34f1f 100644 --- a/packages/dnb-eufemia/src/components/input/Input.js +++ b/packages/dnb-eufemia/src/components/input/Input.js @@ -316,9 +316,6 @@ export default class Input extends React.PureComponent { if (event.key === 'Enter') { dispatchCustomElementEvent(this, 'on_submit', { value, event }) } - if (isTrue(this.props.clear) && event.key === 'Escape') { - this.clearValue(event) - } } clearValue = (event) => { const previousValue = this.state.value diff --git a/packages/dnb-eufemia/src/components/input/__tests__/Input.test.tsx b/packages/dnb-eufemia/src/components/input/__tests__/Input.test.tsx index 4b716637857..a13f5204d45 100644 --- a/packages/dnb-eufemia/src/components/input/__tests__/Input.test.tsx +++ b/packages/dnb-eufemia/src/components/input/__tests__/Input.test.tsx @@ -513,21 +513,6 @@ describe('Input with clear button', () => { expect(clearButton).toHaveAttribute('disabled') }) - it('should clear the value on escape key press', () => { - render() - - expect(document.querySelector('input').getAttribute('value')).toBe( - 'value' - ) - - fireEvent.keyDown(document.querySelector('input'), { - key: 'Escape', - keyCode: 27, // escape - }) - - expect(document.querySelector('input').getAttribute('value')).toBe('') - }) - it('should set focus on input when clear button is pressed', () => { render()