@fibery/ui-kit 1.24.0 → 1.24.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "main": "index.ts",
5
5
  "private": false,
6
6
  "files": [
@@ -23,12 +23,14 @@ const emojiInlineImgCss = css`
23
23
  vertical-align: -0.1em;
24
24
  object-fit: contain;
25
25
  overflow: hidden;
26
+ -webkit-touch-callout: none;
26
27
  `;
27
28
  const emojiSizedImgCss = css`
28
29
  width: 100%;
29
30
  height: 100%;
30
31
  object-fit: contain;
31
32
  overflow: hidden;
33
+ -webkit-touch-callout: none;
32
34
  `;
33
35
 
34
36
  // This is needed to keep text-selection working for image based emojis Details: https://the.fibery.io/SoftDev/bug/Improve-selection-text-with-emojis-8963
@@ -117,18 +117,13 @@ type Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
117
117
  autoFocus?: boolean;
118
118
  defaultMenuIsOpen?: boolean;
119
119
  placeholder?: string;
120
- onInputChange?: (s: string, actionType: {action: string}) => void;
121
120
  noOptionsMessage: () => string | JSX.Element | null;
122
121
  options: OptionsOrGroups<Option, Group>;
123
122
  filterOption?: SelectProps<Option>["filterOption"];
124
123
  inputValue?: string;
125
124
  disabled?: boolean;
126
- onFocus?: () => void;
127
125
  isCollectionMode?: IsMulti;
128
126
  isClearable?: boolean;
129
- onChange: (newValue: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
130
- onMenuOpen: () => void;
131
- onMenuClose: () => void | boolean;
132
127
  renderValue?: () => ReactNode;
133
128
  title?: string;
134
129
  maxMenuHeight?: number;
@@ -139,6 +134,11 @@ type Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
139
134
  formatGroupLabel?: (group: Group) => ReactNode;
140
135
  formatOptionLabel?: (option: Option) => ReactNode;
141
136
  components?: ComponentsConfig;
137
+ onInputChange?: (s: string, actionType: {action: string}) => void;
138
+ onFocus?: () => void;
139
+ onChange: (newValue: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
140
+ onMenuOpen?: () => void;
141
+ onMenuClose?: () => void | boolean;
142
142
  };
143
143
 
144
144
  function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends GroupBase<Option>>(
@@ -151,18 +151,13 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
151
151
  autoFocus,
152
152
  defaultMenuIsOpen,
153
153
  placeholder,
154
- onInputChange,
155
154
  noOptionsMessage,
156
155
  options,
157
156
  filterOption,
158
157
  inputValue,
159
158
  disabled,
160
- onFocus,
161
159
  isCollectionMode,
162
160
  isClearable = true,
163
- onChange,
164
- onMenuOpen,
165
- onMenuClose,
166
161
  renderValue,
167
162
  title,
168
163
  maxMenuHeight,
@@ -173,6 +168,11 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
173
168
  formatGroupLabel,
174
169
  formatOptionLabel,
175
170
  components = {},
171
+ onInputChange,
172
+ onFocus,
173
+ onChange,
174
+ onMenuOpen,
175
+ onMenuClose,
176
176
  } = props;
177
177
  const [triggerElement, setTriggerElement] = useState<HTMLDivElement | null>(null);
178
178
  const [visible, setVisible] = useState(menuIsOpen);
@@ -198,7 +198,7 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
198
198
 
199
199
  const onHide = useCallback(
200
200
  (restoreFocus = true) => {
201
- const wasClosed = onMenuClose();
201
+ const wasClosed = onMenuClose && onMenuClose();
202
202
  if (wasClosed === false) {
203
203
  return;
204
204
  }
@@ -231,7 +231,9 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
231
231
  clearTimeout(blurTimeoutRef.current);
232
232
  }
233
233
  setVisible(true);
234
- onMenuOpen();
234
+ if (onMenuOpen) {
235
+ onMenuOpen();
236
+ }
235
237
  }, [onMenuOpen]);
236
238
 
237
239
  const styles = useMemo(() => {