@thecb/components 6.0.0-beta.26 → 6.0.0-beta.29
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
|
@@ -6301,7 +6301,7 @@ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxS
|
|
|
6301
6301
|
completely off screen (only for users of screen readers)
|
|
6302
6302
|
*/
|
|
6303
6303
|
|
|
6304
|
-
var Box = function
|
|
6304
|
+
var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6305
6305
|
var _ref$padding = _ref.padding,
|
|
6306
6306
|
padding = _ref$padding === void 0 ? "16px" : _ref$padding,
|
|
6307
6307
|
_ref$borderSize = _ref.borderSize,
|
|
@@ -6371,9 +6371,10 @@ var Box = function Box(_ref) {
|
|
|
6371
6371
|
onMouseLeave: onMouseLeave,
|
|
6372
6372
|
onFocus: onFocus,
|
|
6373
6373
|
onBlur: onBlur,
|
|
6374
|
-
onTouchEnd: onTouchEnd
|
|
6374
|
+
onTouchEnd: onTouchEnd,
|
|
6375
|
+
ref: ref
|
|
6375
6376
|
}, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
|
|
6376
|
-
};
|
|
6377
|
+
});
|
|
6377
6378
|
|
|
6378
6379
|
var CenterWrapper = styled.div.withConfig({
|
|
6379
6380
|
displayName: "Centerstyled__CenterWrapper",
|
|
@@ -20743,6 +20744,11 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20743
20744
|
inputChangedByAutofill = _useState14[0],
|
|
20744
20745
|
setInputChangedByAutofill = _useState14[1];
|
|
20745
20746
|
|
|
20747
|
+
var _useState15 = useState(false),
|
|
20748
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
20749
|
+
focusedByClick = _useState16[0],
|
|
20750
|
+
setFocusedByClick = _useState16[1];
|
|
20751
|
+
|
|
20746
20752
|
if (optionsState !== options) {
|
|
20747
20753
|
setOptionsState(options);
|
|
20748
20754
|
setOptionsChanged(true);
|
|
@@ -20753,10 +20759,10 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20753
20759
|
setOptionsChanged(false);
|
|
20754
20760
|
}
|
|
20755
20761
|
|
|
20756
|
-
var
|
|
20757
|
-
|
|
20758
|
-
timer =
|
|
20759
|
-
setTimer =
|
|
20762
|
+
var _useState17 = useState(null),
|
|
20763
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
20764
|
+
timer = _useState18[0],
|
|
20765
|
+
setTimer = _useState18[1];
|
|
20760
20766
|
|
|
20761
20767
|
var optionRefs = useRef(_toConsumableArray(Array(options.length)).map(function () {
|
|
20762
20768
|
return /*#__PURE__*/createRef();
|
|
@@ -20874,11 +20880,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20874
20880
|
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
20875
20881
|
// WAI-ARIA requires the selected option to receive focus
|
|
20876
20882
|
selectedRef.current.focus();
|
|
20877
|
-
console.log("input box ref", inputRef, inputRef.current);
|
|
20878
20883
|
} else if (isOpen && optionRefs.current[0].current) {
|
|
20879
20884
|
// If no selected option, first option receives focus
|
|
20880
20885
|
optionRefs.current[0].current.focus();
|
|
20881
|
-
|
|
20886
|
+
}
|
|
20887
|
+
|
|
20888
|
+
if (isOpen && focusedByClick) {
|
|
20889
|
+
inputRef.current.focus();
|
|
20890
|
+
setFocusedByClick(false);
|
|
20882
20891
|
}
|
|
20883
20892
|
|
|
20884
20893
|
clearTimeout(timer);
|
|
@@ -20927,6 +20936,8 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20927
20936
|
minWidth: "100%",
|
|
20928
20937
|
onClick: function onClick() {
|
|
20929
20938
|
if (!isOpen) {
|
|
20939
|
+
setFocusedByClick(true);
|
|
20940
|
+
|
|
20930
20941
|
_onClick();
|
|
20931
20942
|
}
|
|
20932
20943
|
},
|