@superdispatch/ui-lab 0.47.0 → 0.47.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.
@@ -903,26 +903,15 @@ var EmailAutocomplete = /*#__PURE__*/react.forwardRef((_ref, ref) => {
903
903
  ref: ref,
904
904
  multiple: true,
905
905
  freeSolo: true,
906
- filterSelectedOptions: true,
907
- disableClearable: true,
908
906
  value: value,
907
+ disableClearable: true,
908
+ filterSelectedOptions: true,
909
909
  filterOptions: _filterOptions => {
910
910
  return _filterOptions.filter(option => option !== '');
911
911
  },
912
- onChange: (event, selectedValue) => {
913
- var keyboardEvent = event;
914
- var lastElement = selectedValue[selectedValue.length - 1];
915
- if (keyboardEvent.key === 'Backspace') {
916
- var removeLatesElement = value === null || value === void 0 ? void 0 : value.filter((_, index) => index < value.length - 1);
917
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(removeLatesElement, 'remove-option');
918
- } else if (keyboardEvent.key === 'Enter' && lastElement) {
919
- _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), lastElement], 'select-option');
920
- } else if (lastElement) {
921
- var emails = lastElement.split(',').map(item => item.replace(' ', ''));
922
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, 'select-option');
923
- } else {
924
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(selectedValue, 'select-option');
925
- }
912
+ onChange: (_event, selectedValue, reason) => {
913
+ var emails = selectedValue.flatMap(item => item.split(',')).map(item => item.trim());
914
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, reason);
926
915
  },
927
916
  renderTags: items => {
928
917
  return /*#__PURE__*/jsxRuntime.jsx(ui.Inline, {