This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/test by this push:
     new ef5cd6ef fix: TagSelector component event handling optimization
ef5cd6ef is described below

commit ef5cd6efcadea085c0ceb543a6877e25fa068c5b
Author: shuai <[email protected]>
AuthorDate: Tue Feb 18 18:31:25 2025 +0800

    fix: TagSelector component event handling optimization
---
 ui/src/components/TagSelector/index.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ui/src/components/TagSelector/index.tsx 
b/ui/src/components/TagSelector/index.tsx
index 3ce36819..abacaff6 100644
--- a/ui/src/components/TagSelector/index.tsx
+++ b/ui/src/components/TagSelector/index.tsx
@@ -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) {
@@ -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
@@ -414,6 +414,7 @@ const TagSelector: FC<IProps> = ({
                 placeholder={t('add_btn')}
                 value={searchValue}
                 onChange={handleSearch}
+                onFocus={handleTagSelectorFocus}
               />
             ) : (
               <Form.Control

Reply via email to