@loadsmart/loadsmart-ui 5.8.1 → 5.10.0

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.
@@ -239,8 +239,14 @@ function useSelect(props: SelectProps): useSelectReturn {
239
239
  const options = useOptions({ datasources, adapters })
240
240
 
241
241
  const expandDisabled = useMemo(
242
- () => !query.length && isEmpty(options.get()) && isEmpty(selectable.selected),
243
- [query, options, selectable.selected]
242
+ () =>
243
+ !query.length &&
244
+ isEmpty(options.get()) &&
245
+ isEmpty(selectable.selected) &&
246
+ isFunction(isValidNewOption)
247
+ ? !isValidNewOption(query)
248
+ : !isValidNewOption,
249
+ [query, options, selectable.selected, isValidNewOption]
244
250
  )
245
251
 
246
252
  const dropdown = useDropdown({ ...props, expandDisabled })