Skip to content

Commit 2e91620

Browse files
committed
fix: remove stop propagation in customInput
1 parent 9d36d99 commit 2e91620

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/Shared/Components/CustomInput/CustomInput.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { InputHTMLAttributes, useEffect, useRef } from 'react'
17+
import { useEffect, useRef } from 'react'
1818
import { FormFieldWrapper, getFormFieldAriaAttributes } from '@Shared/Components/FormFieldWrapper'
1919
import {
2020
COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP,
@@ -75,14 +75,6 @@ const CustomInput = ({
7575
onBlur?.(event)
7676
}
7777

78-
const handleKeyDown: InputHTMLAttributes<HTMLInputElement>['onKeyDown'] = (event) => {
79-
if (event.key === 'Enter' || event.key === 'Escape') {
80-
event.stopPropagation()
81-
}
82-
83-
props.onKeyDown?.(event)
84-
}
85-
8678
const handleEndIconButtonClick: CustomInputProps['endIconButtonConfig']['onClick'] = (event) => {
8779
event.stopPropagation()
8880
inputRef.current.focus()
@@ -123,7 +115,7 @@ const CustomInput = ({
123115
data-testid={name}
124116
required={required}
125117
onBlur={handleBlur}
126-
onKeyDown={handleKeyDown}
118+
onKeyDown={props.onKeyDown}
127119
type={type}
128120
ref={inputRef}
129121
className={`${COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP[size]} ${COMPONENT_SIZE_TYPE_TO_INLINE_PADDING_MAP[size]} ${deriveBorderRadiusAndBorderClassFromConfig({ borderConfig, borderRadiusConfig })} ${endIconButtonConfig ? `custom-input__with-icon-button--${size}` : ''} w-100 dc__overflow-auto`}

0 commit comments

Comments
 (0)