You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by eno-tech0 July 28, 2023
I need the ability to show the mask placeholder when focusing on an input. I tried to implement it via onFocus/onBlur, but got unexpected behavior.
If the field does not have a default value, then when a value is entered and unfocused, the label is lowered (expected behavior: the label remains raised if a value is entered in the field).
If the field has a default value and the entire value is erased - the label is not lowered (expected behavior: the label is lowered if the entire value is erased).
How can I get the expected behavior?
This discussion was converted from issue #921 on August 02, 2023 08:37.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Discussed in #920
Originally posted by eno-tech0 July 28, 2023
I need the ability to show the mask placeholder when focusing on an input. I tried to implement it via onFocus/onBlur, but got unexpected behavior.
If the field does not have a default value, then when a value is entered and unfocused, the label is lowered (expected behavior: the label remains raised if a value is entered in the field).
If the field has a default value and the entire value is erased - the label is not lowered (expected behavior: the label is lowered if the entire value is erased).
How can I get the expected behavior?
Here's an example: https://codesandbox.io/s/imask-mui-react-hook-form-swrc3w?file=/src/App.js
Beta Was this translation helpful? Give feedback.
All reactions