ish-ui 1.3.1 → 1.3.3

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.
@@ -35,6 +35,12 @@ const DynamicSizeList = React.forwardRef(({ children, itemCount, itemData, heigh
35
35
  (_a = listApi.current) === null || _a === void 0 ? void 0 : _a.scrollToRow({ index, align });
36
36
  },
37
37
  }), []);
38
- return (React.createElement(List, { className: className, style: { height, width }, listRef: attachRefs, rowComponent: children, rowProps: { data: itemData }, rowCount: itemCount, rowHeight: rowHeight, overscanCount: overscanCount }));
38
+ return (React.createElement(List, { className: className,
39
+ // react-window v2 defaults the container to `maxHeight: 100%`. Callers
40
+ // commonly wrap this in react-virtualized-auto-sizer, whose wrapper is
41
+ // `height: 0` and expects the child to overflow it, so that 100% would
42
+ // resolve to zero and the list would render nothing. An explicit height
43
+ // supersedes the cap; without one, v2's default is left alone.
44
+ style: Object.assign({ height, width }, (height == null ? {} : { maxHeight: 'none' })), listRef: attachRefs, rowComponent: children, rowProps: { data: itemData }, rowCount: itemCount, rowHeight: rowHeight, overscanCount: overscanCount }));
39
45
  });
40
46
  export default DynamicSizeList;
@@ -217,7 +217,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
217
217
  };
218
218
  const renderOption = (optionProps, data) => {
219
219
  if (typeof itemRenderer === 'function') {
220
- return itemRenderer(getHighlightedPartLabel(getOptionLabel(data), searchValue), data, searchValue, optionProps);
220
+ return [itemRenderer(getHighlightedPartLabel(getOptionLabel(data), searchValue), data, searchValue, optionProps), optionProps];
221
221
  }
222
222
  return [getHighlightedPartLabel(getOptionLabel(data), searchValue), optionProps];
223
223
  };
@@ -231,6 +231,7 @@ export interface TagsFieldProps<T, IP, MP> extends EditInPlaceFieldProps<IP, MP>
231
231
  validateEntity?: string;
232
232
  allowParentSelect?: boolean;
233
233
  hideColor?: boolean;
234
+ trackCarretPosition?: boolean;
234
235
  }
235
236
  export interface FormFieldBaseProps {
236
237
  required?: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FieldInputProps, FieldMetaProps, TagLike, TagsFieldProps } from '../model';
3
- declare function TagInputList<T extends TagLike, IP extends FieldInputProps, MP extends FieldMetaProps>({ input, tags, placeholder, labelAdornment, meta, label, disabled, className, warning, allowParentSelect, fieldClasses, editIcon, variant, hideColor }: TagsFieldProps<T, IP, MP>): React.JSX.Element;
3
+ declare function TagInputList<T extends TagLike, IP extends FieldInputProps, MP extends FieldMetaProps>({ input, tags, placeholder, labelAdornment, meta, label, disabled, className, warning, allowParentSelect, fieldClasses, editIcon, variant, hideColor, trackCarretPosition }: TagsFieldProps<T, IP, MP>): React.JSX.Element;
4
4
  export default TagInputList;
@@ -98,7 +98,7 @@ const getFullTag = (tagId, tags) => {
98
98
  ++i;
99
99
  }
100
100
  };
101
- function TagInputList({ input, tags, placeholder, labelAdornment, meta, label = 'Tags', disabled, className, warning, allowParentSelect, fieldClasses = {}, editIcon, variant, hideColor }) {
101
+ function TagInputList({ input, tags, placeholder, labelAdornment, meta, label = 'Tags', disabled, className, warning, allowParentSelect, fieldClasses = {}, editIcon, variant, hideColor, trackCarretPosition = true }) {
102
102
  const [menuIsOpen, setMenuIsOpen] = useState(false);
103
103
  const [activeTag, setActiveTag] = useState(null);
104
104
  const [isEditing, setIsEditing] = useState(false);
@@ -190,7 +190,7 @@ function TagInputList({ input, tags, placeholder, labelAdornment, meta, label =
190
190
  React.createElement("div", { className: cx('relative', {
191
191
  'pointer-events-none': disabled
192
192
  }) }, React.createElement(Autocomplete, { value: input.value, multiple: true, open: menuIsOpen, options: filteredOptions, onBlur: exit, onChange: handleChange, renderOption: renderOption, filterOptions: filterOptionsInner, getOptionLabel: getOptionLabel, slots: {
193
- popper: inputValue ? undefined : popperAdapter,
193
+ popper: inputValue || !trackCarretPosition ? undefined : popperAdapter,
194
194
  listbox: inputValue ? undefined : listboxAdapter
195
195
  }, classes: {
196
196
  root: classes.root,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ish-ui",
3
3
  "sideEffects": false,
4
- "version": "1.3.1",
4
+ "version": "1.3.3",
5
5
  "description": "UI elements for onCourse and other ish apps",
6
6
  "main": "main.ts",
7
7
  "devDependencies": {