stream-chat-react 10.8.0 → 10.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/AutoCompleteTextarea/Textarea.jsx"],"names":[],"mappings":"AAkBA;IACE;;;;;;;MAOE;IA2WF;;OAEG;IACH;;;aAMC;IAlXD,wBA4BC;IAZC;;;;;;;;;;;MAWC;IAGH;;;aAOE;IAEF,2BAOE;IAEF,8CAKE;IAEF,+BAIE;IAEF;;;;;;OAMG;IACH,8CAC6E;IAE7E,qCAUE;IAEF,+BAcE;IAEF,qBAQE;IAEF,yBA6BE;IAEF,mCAqEE;IAEF,qEAuBE;IAEF,sEA2DE;IAEF,uDAQE;IAEF,mCA0CE;IAEF,6CAQE;IAYF;;OAEG;IACH,+BAQE;IAEF;;MA6CE;IAEF,mCAME;IAEF,iCA+EE;IAEF,iCASE;IAGF,yCAiBE;IAEF,6BAAmD;IAEnD,qCAiBE;IAEF;;;;;;;;MAoCE;IAEF,uCAEE;IADA,iBAA0B;IAG5B,oDA2CC;IAED,sBA2EC;IATS,oDAAsB;CAUjC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/AutoCompleteTextarea/Textarea.jsx"],"names":[],"mappings":"AAmBA;IACE;;;;;;;MAOE;IA2WF;;OAEG;IACH;;;aAMC;IAlXD,wBA4BC;IAZC;;;;;;;;;;;MAWC;IAGH;;;aAOE;IAEF,2BAOE;IAEF,8CAKE;IAEF,+BAIE;IAEF;;;;;;OAMG;IACH,8CAC6E;IAE7E,qCAUE;IAEF,+BAcE;IAEF,qBAQE;IAEF,yBA6BE;IAEF,mCAqEE;IAEF,qEAuBE;IAEF,sEA2DE;IAEF,uDAQE;IAEF,mCA0CE;IAEF,6CAQE;IAYF;;OAEG;IACH,+BAQE;IAEF;;MA6CE;IAEF,mCAME;IAEF,iCA+EE;IAEF,iCASE;IAGF,yCA0BE;IAEF,6BAAmD;IAEnD,qCAiBE;IAEF;;;;;;;;MAoCE;IAEF,uCAEE;IADA,iBAA0B;IAG5B,oDA2CC;IAED,sBA2EC;IATS,oDAAsB;CAUjC"}
@@ -45,6 +45,7 @@ import { List as DefaultSuggestionList } from './List';
45
45
  import { DEFAULT_CARET_POSITION, defaultScrollToItem, errorMessage, triggerPropsCheck, } from './utils';
46
46
  import { CommandItem } from '../CommandItem';
47
47
  import { UserItem } from '../UserItem';
48
+ import { isSafari } from '../../utils/browsers';
48
49
  var ReactTextareaAutocomplete = /** @class */ (function (_super) {
49
50
  __extends(ReactTextareaAutocomplete, _super);
50
51
  function ReactTextareaAutocomplete(props) {
@@ -445,7 +446,14 @@ var ReactTextareaAutocomplete = /** @class */ (function (_super) {
445
446
  // that was actually clicked. If we clicked inside the auto-select dropdown, then
446
447
  // that's not a blur, from the auto-select point of view, so then do nothing.
447
448
  var el = e.relatedTarget;
448
- if (_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el)) {
449
+ // If this is a blur event in Safari, then relatedTarget is never a dropdown item, but a common parent
450
+ // of textarea and dropdown container. That means that dropdownRef will not contain its parent and the
451
+ // autocomplete will be closed before onclick handler can be invoked selecting an item.
452
+ // It seems that Safari has different implementation determining the relatedTarget node than Chrome and Firefox.
453
+ // Therefore, if focused away in Safari, the dropdown will be kept rendered until pressing Esc or selecting and item from it.
454
+ var focusedAwayInSafari = isSafari() && e.type === 'blur';
455
+ if ((_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el)) ||
456
+ focusedAwayInSafari) {
449
457
  return;
450
458
  }
451
459
  if (closeOnClickOutside)