x-ui-design 0.3.39 → 0.3.40

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/dist/index.esm.js CHANGED
@@ -3258,6 +3258,16 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3258
3258
  setSearchInputWidth(searchContent.clientWidth - PADDING_TAG_INPUT);
3259
3259
  }
3260
3260
  const timeout = setTimeout(() => {
3261
+ if (!hasMode) {
3262
+ const selectedOption = selectRef.current?.getElementsByClassName('selected')[0];
3263
+ if (selectedOption) {
3264
+ const selectedOptionTop = selectRef.current?.getElementsByClassName('selected')[0].getBoundingClientRect()?.top || 0;
3265
+ selectRef.current?.getElementsByClassName(`${prefixCls}-options`)[0]?.scrollTo({
3266
+ top: selectedOptionTop - selectedOption.clientHeight - PADDING_PLACEMENT - PADDING_TAG_INPUT,
3267
+ behavior: 'smooth'
3268
+ });
3269
+ }
3270
+ }
3261
3271
  const searchInput = document.getElementById(`${prefixCls}-search-tag-input`);
3262
3272
  if (searchInput) {
3263
3273
  searchInput?.focus();
@@ -3386,7 +3396,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3386
3396
  contentEditable: "plaintext-only",
3387
3397
  id: `${prefixCls}-search-tag-input`,
3388
3398
  className: `${prefixCls}-tag-input`
3389
- }), !searchQuery.length ? selected === '' ? placeholder : extractedOptions.find(e => e.value === selected)?.children || selected : null) : !hasMode ? /*#__PURE__*/React$1.createElement("div", {
3399
+ }), !hasMode && !searchQuery.length ? selected === '' ? placeholder : extractedOptions.find(e => e.value === selected)?.children || selected : null) : !hasMode ? /*#__PURE__*/React$1.createElement("div", {
3390
3400
  className: `${prefixCls}-input globalEllipsis`,
3391
3401
  style: {
3392
3402
  opacity: isOpen || selected === '' ? '0.6' : '1'