microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.48k stars 2.73k forks source link

MaskedTextField should allow the mask to change on the fly. #5539

Closed jlubben closed 3 years ago

jlubben commented 6 years ago

Inside of MaskedInput, we have the _onInputChanged method. Let's say we have an arbitrary mask "99999" and the current input string is "12345". in the case that the beginning of the string is exactly "1234" I want to allow the mask to change to also allow alphebtical letters on the 5th character to yield something like "1234A". However, after _onInputChange calls my input change via this.props.onChanged(value), it never provides a way for an updated mask. Therefore, it retains the old mask and this causes problems.

It should be possible to allow the masks to change on the fly.

dzearing commented 6 years ago

@lambertwang Fyi

Also I find it confusing that MaskedTextField doesn't have its own interface. TextFieldProps lists a bunch of masked options but this isn't applicable to TextField...

JustSlone commented 3 years ago

Linked this to the TextField epic issue, closing out this particular instance as we won't be solving this outside of component convergence