@reach/combobox
Advanced tools
Comparing version 0.5.3 to 0.6.1
@@ -7,8 +7,2 @@ var _on, _on2, _on3, _on4, _states; | ||
/* eslint-disable jsx-a11y/role-has-required-aria-props */ | ||
/* eslint-disable jsx-a11y/aria-proptypes */ | ||
/* eslint-disable jsx-a11y/role-supports-aria-props */ | ||
/* eslint-disable default-case */ | ||
@@ -23,4 +17,4 @@ //////////////////////////////////////////////////////////////////////////////// | ||
import React, { forwardRef, createContext, useEffect, useLayoutEffect, useRef, useContext, useMemo, useReducer, useState } from "react"; | ||
import { func } from "prop-types"; | ||
import { wrapEvent, useForkedRef } from "@reach/utils"; | ||
import PropTypes from "prop-types"; | ||
import { makeId, wrapEvent, useForkedRef } from "@reach/utils"; | ||
import { findAll } from "highlight-words-core"; | ||
@@ -198,3 +192,4 @@ import escapeRegexp from "escape-regexp"; | ||
useFocusManagement(data.lastActionType, inputRef); | ||
var listboxId = "listbox--" + useId(); | ||
var id = useId(rest.id); | ||
var listboxId = makeId("listbox", id); | ||
var context = useMemo(function () { | ||
@@ -231,3 +226,3 @@ return { | ||
Combobox.propTypes = { | ||
onSelect: func | ||
onSelect: PropTypes.func | ||
}; | ||
@@ -273,3 +268,3 @@ } //////////////////////////////////////////////////////////////////////////////// | ||
useLayoutEffect(function () { | ||
autocompletePropRef.current = autocomplete; | ||
autocompletePropRef.current = autocomplete; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [autocomplete]); | ||
@@ -534,3 +529,4 @@ | ||
inputRef.current.focus(); | ||
} | ||
} // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [lastActionType]); | ||
@@ -537,0 +533,0 @@ } // We want the same events when the input or the popup have focus (HOW COOL ARE |
14
index.js
@@ -9,3 +9,3 @@ "use strict"; | ||
var _propTypes = require("prop-types"); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
@@ -28,3 +28,3 @@ var _utils = require("@reach/utils"); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -203,3 +203,4 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
useFocusManagement(data.lastActionType, inputRef); | ||
var listboxId = "listbox--" + (0, _autoId.useId)(); | ||
var id = (0, _autoId.useId)(rest.id); | ||
var listboxId = (0, _utils.makeId)("listbox", id); | ||
var context = (0, _react.useMemo)(function () { | ||
@@ -237,3 +238,3 @@ return { | ||
Combobox.propTypes = { | ||
onSelect: _propTypes.func | ||
onSelect: _propTypes["default"].func | ||
}; | ||
@@ -279,3 +280,3 @@ } //////////////////////////////////////////////////////////////////////////////// | ||
(0, _react.useLayoutEffect)(function () { | ||
autocompletePropRef.current = autocomplete; | ||
autocompletePropRef.current = autocomplete; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [autocomplete]); | ||
@@ -548,3 +549,4 @@ | ||
inputRef.current.focus(); | ||
} | ||
} // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [lastActionType]); | ||
@@ -551,0 +553,0 @@ } // We want the same events when the input or the popup have focus (HOW COOL ARE |
{ | ||
"name": "@reach/combobox", | ||
"version": "0.5.3", | ||
"version": "0.6.1", | ||
"description": "Accessible React Combobox (Autocomplete).", | ||
@@ -13,6 +13,6 @@ "author": "React Training <hello@reacttraining.com>", | ||
"dependencies": { | ||
"@reach/auto-id": "^0.5.3", | ||
"@reach/popover": "^0.5.0", | ||
"@reach/portal": "^0.5.0", | ||
"@reach/utils": "^0.5.0", | ||
"@reach/auto-id": "^0.6.1", | ||
"@reach/popover": "^0.6.1", | ||
"@reach/portal": "^0.6.1", | ||
"@reach/utils": "^0.6.1", | ||
"escape-regexp": "0.0.1", | ||
@@ -40,3 +40,3 @@ "highlight-words-core": "1.2.0", | ||
], | ||
"gitHead": "29e599938054fd0601f347f66d8671e690ecf879" | ||
"gitHead": "c1e249448a3672ccc65698218f0f38ef9814ab90" | ||
} |
@@ -1,4 +0,1 @@ | ||
/* eslint-disable jsx-a11y/role-has-required-aria-props */ | ||
/* eslint-disable jsx-a11y/aria-proptypes */ | ||
/* eslint-disable jsx-a11y/role-supports-aria-props */ | ||
/* eslint-disable default-case */ | ||
@@ -26,4 +23,4 @@ | ||
} from "react"; | ||
import { func } from "prop-types"; | ||
import { wrapEvent, useForkedRef } from "@reach/utils"; | ||
import PropTypes from "prop-types"; | ||
import { makeId, wrapEvent, useForkedRef } from "@reach/utils"; | ||
import { findAll } from "highlight-words-core"; | ||
@@ -266,3 +263,4 @@ import escapeRegexp from "escape-regexp"; | ||
const listboxId = `listbox--${useId()}`; | ||
const id = useId(rest.id); | ||
const listboxId = makeId("listbox", id); | ||
@@ -307,3 +305,3 @@ const context = useMemo(() => { | ||
Combobox.propTypes = { | ||
onSelect: func | ||
onSelect: PropTypes.func | ||
}; | ||
@@ -362,2 +360,3 @@ } | ||
autocompletePropRef.current = autocomplete; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [autocomplete]); | ||
@@ -668,2 +667,3 @@ | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [lastActionType]); | ||
@@ -670,0 +670,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91996
2262
+ Added@reach/auto-id@0.6.1(transitive)
+ Added@reach/component-component@0.6.2(transitive)
+ Added@reach/popover@0.6.4(transitive)
+ Added@reach/portal@0.6.2(transitive)
+ Added@reach/rect@0.6.2(transitive)
+ Added@reach/utils@0.6.4(transitive)
- Removed@reach/auto-id@0.5.3(transitive)
- Removed@reach/component-component@0.5.0(transitive)
- Removed@reach/popover@0.5.0(transitive)
- Removed@reach/portal@0.5.0(transitive)
- Removed@reach/rect@0.5.0(transitive)
- Removed@reach/utils@0.5.0(transitive)
Updated@reach/auto-id@^0.6.1
Updated@reach/popover@^0.6.1
Updated@reach/portal@^0.6.1
Updated@reach/utils@^0.6.1