use-mask-input 3.4.1 → 3.4.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.4.2](https://github.com/eduardoborges/use-mask-input/compare/3.4.1...3.4.2) (2024-11-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * mui textfield disappearing ([#95](https://github.com/eduardoborges/use-mask-input/issues/95)) ([fa0caf6](https://github.com/eduardoborges/use-mask-input/commit/fa0caf66fe05f33e5a5aeaf3e92b38352ca46abb))
7
+
1
8
  ## [3.4.1](https://github.com/eduardoborges/use-mask-input/compare/3.4.0...3.4.1) (2024-11-22)
2
9
 
3
10
 
package/dist/index.cjs CHANGED
@@ -3849,6 +3849,7 @@ const getMaskOptions = (mask, _options) => {
3849
3849
  ...options
3850
3850
  },
3851
3851
  // alias for brazilians <3
3852
+ // ty <3
3852
3853
  "brl-currency": {
3853
3854
  alias: "currency",
3854
3855
  prefix: "R$ ",
@@ -3907,7 +3908,14 @@ function useHookFormMask(registerFn) {
3907
3908
  const { ref, ...restRegister } = registerFn(fieldName, options);
3908
3909
  const maskInput = inputmask(getMaskOptions(mask, options));
3909
3910
  const newRef = flow((_ref) => {
3910
- if (_ref) maskInput.mask(_ref);
3911
+ if (_ref) {
3912
+ const { nodeName } = _ref;
3913
+ if (nodeName !== "INPUT") {
3914
+ maskInput.mask(_ref.querySelector("input"));
3915
+ } else {
3916
+ maskInput.mask(_ref);
3917
+ }
3918
+ }
3911
3919
  return _ref;
3912
3920
  }, ref);
3913
3921
  return {