Explorar o código

Add event.stopPropagation to button clicks in AiAssistantKeywordSearch for improved event handling

Shun Miyazawa hai 8 meses
pai
achega
4f6ed1be2b

+ 14 - 2
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManagementModal/AiAssistantManagementKeywordSearch.tsx

@@ -132,8 +132,20 @@ export const AiAssistantKeywordSearch = (): JSX.Element => {
             <div className="px-4 list-group">
             <div className="px-4 list-group">
               {searchResult?.data.map((page) => {
               {searchResult?.data.map((page) => {
                 return (
                 return (
-                  <button type="button" className="list-group-item list-group-item-action d-flex align-items-center p-1 mb-2 rounded">
-                    <button type="button" className="btn text-primary">
+                  <button
+                    type="button"
+                    className="list-group-item list-group-item-action d-flex align-items-center p-1 mb-2 rounded"
+                    onClick={(e) => {
+                      e.stopPropagation();
+                    }}
+                  >
+                    <button
+                      type="button"
+                      className="btn text-primary"
+                      onClick={(e) => {
+                        e.stopPropagation();
+                      }}
+                    >
                       <span className="material-symbols-outlined">
                       <span className="material-symbols-outlined">
                         add_circle
                         add_circle
                       </span>
                       </span>