Skip to content

Problem with using it together with mui #921

@eno-tech0

Description

@eno-tech0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions