Skip to content

Commit

Permalink
fix #839, fix #862
Browse files Browse the repository at this point in the history
  • Loading branch information
uNmAnNeR committed Jun 8, 2023
1 parent 8b7d587 commit cacafbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-imask/src/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ export default function IMaskMixin<
}

_extractNonMaskProps (props: Readonly<IMaskInputProps<Opts, Unmask, Value, MaskElement, MaskElementProps>>): MaskElementProps {
const { ...cloneProps } = props;
const { ...cloneProps } = props as any;

(MASK_PROPS_NAMES as Array<keyof IMaskMixinProps<Opts, Unmask, Value, MaskElement>>).forEach(maskProp => {
delete cloneProps[maskProp];
});
if (!('defaultValue' in cloneProps)) cloneProps.defaultValue = props.mask ? '' : cloneProps.value;
delete cloneProps.value;

return cloneProps as MaskElementProps;
}
Expand Down

0 comments on commit cacafbd

Please sign in to comment.