@bbl-digital/snorre 3.0.8 → 3.0.9

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.
@@ -38,8 +38,6 @@ const useAutocomplete = props => {
38
38
  const onFuzzyBlur = e => {
39
39
  // If the value of the input is changed, and does not match the value of the values array,
40
40
  // we should revert back the input value to the original value
41
- //What
42
- // if (!e.target.value.length) clearSelectedItem()
43
41
  if (e.target.value === props.value) return; // If target value is the same as a value from the values array, we should set the value for the user
44
42
 
45
43
  if (inputValues?.length) {
@@ -57,11 +55,6 @@ const useAutocomplete = props => {
57
55
  }
58
56
  };
59
57
 
60
- const onFuzzyFocus = () => {
61
- setValueChanged('');
62
- if (props.values?.length) setShowValues(true);
63
- };
64
-
65
58
  const renderedValues = useMemo(() => {
66
59
  if (!props.values?.length) return [];
67
60
 
@@ -231,7 +224,6 @@ const useAutocomplete = props => {
231
224
  handleCustomOnKeyDown,
232
225
  handleOnInputClick,
233
226
  onFuzzyBlur,
234
- onFuzzyFocus,
235
227
  value,
236
228
  highlightedIndex,
237
229
  showValues,
@@ -37,8 +37,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
37
37
  handleOnKeyDown,
38
38
  handleValueClick,
39
39
  onInputChange,
40
- onFuzzyBlur,
41
- onFuzzyFocus
40
+ onFuzzyBlur
42
41
  } = useAutocomplete(props);
43
42
  useEffect(() => {
44
43
  const handleClickOutside = e => {
@@ -60,8 +59,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
60
59
  return _jsxs(_Fragment, {
61
60
  children: [_jsxs("label", {
62
61
  ref: inputWrapperRef,
63
- css: theme => [styles.default(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), props.validation && styles.validation, props.onLabelClick && styles.clickableLabel, height && styles.height(height), css && css],
64
62
  onClick: props.onLabelClick ? e => e.preventDefault() : undefined,
63
+ css: theme => [styles.default(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), props.validation && styles.validation, props.onLabelClick && styles.clickableLabel, height && styles.height(height), css && css],
65
64
  children: [_jsxs("span", {
66
65
  css: styles.label,
67
66
  children: [props.label && (props.onLabelClick ? _jsx(Link, {
@@ -83,7 +82,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
83
82
  disabled: props.disabled,
84
83
  autoFocus: props.focus,
85
84
  onBlur: props.fuzzy ? onFuzzyBlur : props.onBlur,
86
- onFocus: props.fuzzy ? onFuzzyFocus : props.onFocus,
85
+ onFocus: props.onFocus,
87
86
  onChange: onInputChange,
88
87
  onKeyDown: props.onKeyDown ? handleCustomOnKeyDown : handleOnKeyDown,
89
88
  onClick: handleOnInputClick,