Skip to content

Commit

Permalink
fix: TagSelector component event handling optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
shuashuai committed Feb 18, 2025
1 parent adab096 commit ef5cd6e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/src/components/TagSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ const TagSelector: FC<IProps> = ({
e.stopPropagation();
const { keyCode } = e;
if (keyCode === 9) {
handleTagSelectorBlur();
console.log('tab====9');
// handleTagSelectorBlur();
return;
}
if (value.length > 0 && keyCode === 8 && !searchValue) {
Expand Down Expand Up @@ -369,13 +370,12 @@ const TagSelector: FC<IProps> = ({
return (
<div ref={containerRef} className="position-relative">
<div
tabIndex={0}
className={classNames(
'tag-selector-wrap form-control position-relative p-0',
focusState ? 'tag-selector-wrap--focus' : '',
isInvalid ? 'is-invalid' : '',
)}
onFocus={handleTagSelectorFocus}
onClick={handleTagSelectorFocus}
onKeyDown={handleKeyDown}>
<div onClick={handleClickToggle}>
<div
Expand Down Expand Up @@ -414,6 +414,7 @@ const TagSelector: FC<IProps> = ({
placeholder={t('add_btn')}
value={searchValue}
onChange={handleSearch}
onFocus={handleTagSelectorFocus}
/>
) : (
<Form.Control
Expand Down

0 comments on commit ef5cd6e

Please sign in to comment.