x-ui-design 1.0.23 → 1.0.24

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.js CHANGED
@@ -3874,7 +3874,9 @@ const InputComponent = /*#__PURE__*/React.forwardRef(({
3874
3874
  // @ts-expect-error
3875
3875
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3876
3876
  __injected,
3877
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3877
3878
  defaultValue,
3879
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3878
3880
  child,
3879
3881
  ...props
3880
3882
  }, ref) => {
@@ -3885,14 +3887,21 @@ const InputComponent = /*#__PURE__*/React.forwardRef(({
3885
3887
  const [iconRenderVisible, setIconRenderVisible] = React.useState(false);
3886
3888
  const animationRef = React.useRef(null);
3887
3889
  React.useImperativeHandle(ref, () => ({
3888
- focus: () => inputRef.current?.focus(),
3889
- blur: () => inputRef.current?.blur(),
3890
+ focus: () => {
3891
+ console.info('focusing');
3892
+ inputRef.current?.focus();
3893
+ },
3894
+ blur: () => {
3895
+ inputRef.current?.blur();
3896
+ },
3890
3897
  input: inputRef.current,
3891
3898
  nativeElement: inputRef.current,
3892
3899
  setSelectionRange: (start, end) => {
3893
- inputRef.current?.setSelectionRange(start, end);
3900
+ if (inputRef.current) {
3901
+ inputRef.current.setSelectionRange(start, end);
3902
+ }
3894
3903
  }
3895
- }), [inputRef]);
3904
+ }), [ref]);
3896
3905
  React.useEffect(() => {
3897
3906
  setMaskValue(mask ? applyMask(stripMask(`${value ?? ''}`, mask, maskChar), mask, maskChar).masked : value ?? '');
3898
3907
  }, [value, mask, maskChar]);