baseui 0.0.0-next-a33b16f → 0.0.0-next-a3fb288

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.
@@ -436,6 +436,12 @@ class Select extends React.Component {
436
436
  _defineProperty(this, "handleInputRef", input => {
437
437
  this.input = input;
438
438
 
439
+ if (typeof this.props.inputRef === 'function') {
440
+ this.props.inputRef(input);
441
+ } else if (this.props.inputRef) {
442
+ this.props.inputRef.current = input;
443
+ }
444
+
439
445
  if (this.props.controlRef && typeof this.props.controlRef === 'function') {
440
446
  this.props.controlRef(input);
441
447
  }
@@ -511,6 +511,12 @@ var Select = /*#__PURE__*/function (_React$Component) {
511
511
  _defineProperty(_assertThisInitialized(_this), "handleInputRef", function (input) {
512
512
  _this.input = input;
513
513
 
514
+ if (typeof _this.props.inputRef === 'function') {
515
+ _this.props.inputRef(input);
516
+ } else if (_this.props.inputRef) {
517
+ _this.props.inputRef.current = input;
518
+ }
519
+
514
520
  if (_this.props.controlRef && typeof _this.props.controlRef === 'function') {
515
521
  _this.props.controlRef(input);
516
522
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "0.0.0-next-a33b16f",
3
+ "version": "0.0.0-next-a3fb288",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",
package/select/index.d.ts CHANGED
@@ -111,6 +111,7 @@ export interface SelectProps {
111
111
  }) => React.ReactNode;
112
112
  getValueLabel?: (args: { option: Option }) => React.ReactNode;
113
113
  id?: string;
114
+ inputRef?: React.Ref<any>;
114
115
  controlRef?: React.Ref<ImperativeMethods>;
115
116
  isLoading?: boolean;
116
117
  labelKey?: string;
@@ -530,6 +530,12 @@ var Select = /*#__PURE__*/function (_React$Component) {
530
530
  _defineProperty(_assertThisInitialized(_this), "handleInputRef", function (input) {
531
531
  _this.input = input;
532
532
 
533
+ if (typeof _this.props.inputRef === 'function') {
534
+ _this.props.inputRef(input);
535
+ } else if (_this.props.inputRef) {
536
+ _this.props.inputRef.current = input;
537
+ }
538
+
533
539
  if (_this.props.controlRef && typeof _this.props.controlRef === 'function') {
534
540
  _this.props.controlRef(input);
535
541
  }
@@ -497,11 +497,16 @@ class Select extends React.Component<PropsT, SelectStateT> {
497
497
  }
498
498
  };
499
499
 
500
- // This method is to preserve backwards compatibility for users using controlRef to directly
501
- // access the input element. This capability is not documented, and may be removed in the future.
502
500
  //flowlint-next-line unclear-type:off
503
501
  handleInputRef = (input: React.ElementRef<any>) => {
504
502
  this.input = input;
503
+
504
+ if (typeof this.props.inputRef === 'function') {
505
+ this.props.inputRef(input);
506
+ } else if (this.props.inputRef) {
507
+ this.props.inputRef.current = input;
508
+ }
509
+
505
510
  if (this.props.controlRef && typeof this.props.controlRef === 'function') {
506
511
  this.props.controlRef(input);
507
512
  }
@@ -138,6 +138,7 @@ export type PropsT = {
138
138
  id?: string,
139
139
  /** Defines if the comparison for a new creatable value should be case-insensitive. */
140
140
  ignoreCase?: boolean,
141
+ inputRef?: ReactRefT<HTMLInputElement>,
141
142
  /** An imperative handle exposing internal methods. */
142
143
  controlRef?: ControlRefT,
143
144
  /** Defines if the select is in a loading (async) state. */