File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -429,17 +429,22 @@ class ChatContainer extends LightElement {
429429 } {
430430 if ( ! ( x instanceof HTMLElement ) ) return { } ;
431431
432+ const el = x . closest ( ".suggestion, [data-suggestion]" ) ;
433+ if ( ! ( el instanceof HTMLElement ) ) return { } ;
434+
432435 const isSuggestion =
433- x . classList . contains ( "suggestion" ) || x . dataset . suggestion !== undefined ;
436+ el . classList . contains ( "suggestion" ) ||
437+ el . dataset . suggestion !== undefined ;
434438 if ( ! isSuggestion ) return { } ;
435439
436- const suggestion = x . dataset . suggestion || x . textContent ;
440+ const suggestion = el . dataset . suggestion || el . textContent ;
437441
438442 return {
439443 suggestion : suggestion || undefined ,
440444 submit :
441- x . classList . contains ( "submit" ) ||
442- [ "" , "true" ] . includes ( x . dataset . suggestionSubmit || "false" ) ,
445+ el . classList . contains ( "submit" ) ||
446+ el . dataset . suggestionSubmit === "" ||
447+ el . dataset . suggestionSubmit === "true" ,
443448 } ;
444449 }
445450
You can’t perform that action at this time.
0 commit comments