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.53k stars 2.74k forks source link

Improve [un]controlled behavior #8044

Closed jdhuntington closed 5 years ago

jdhuntington commented 5 years ago

Several components in Fabric 6 yield non-deterministic behavior when props that are meant to set the initial state are used concurrently with props that are meant to fully control the component. In Fabric 7, two changes will take place. First, all use of conflicting props (e.g. initialSelectedKey along with selectedKey) will result in a warning to be emitted when running in development mode. Second, where possible, all such uses will result in purely deterministic behavior.

Vitalius1 commented 5 years ago

@jdhuntington I am having an issue with a controlled MaskedTextField which I do believe is tracing all the way to TextField. Here is a codepen demoing it. Try to change the second input 😢 . I wonder if you already started looking into improving the controlled behavior and if this is something you encountered already.

jdhuntington commented 5 years ago

High-level details exist at https://github.com/OfficeDev/office-ui-fabric-react/wiki/Component-Status , and will be used to create new work items.