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

[MaskedTextField] The field does not respond to the event settings. #4904

Closed IASamoylov closed 6 years ago

IASamoylov commented 6 years ago

Bug Report

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? (Yes)

Requested priority: (Normal)

Describe the issue:

MaskedTextField ignores all user-defined event handlers and does not work with validateOnFocusIn/validateOnFocusOut attribute(when they are set by user)

epwNV_

Actual behavior:

Expected behavior:

If applicable, please provide a codepen repro:

https://jsfiddle.net/x4tcuLpa/5/

jordandrako commented 6 years ago

It seems to accept almost all native attributes, but onKeyDown is used to check the value against the mask, should be simple to add the onKeyDown prop to the method it calls, and all the other default attributes it takes over.

However, I'm not sure why the validation options aren't working. @lambertwang Can you take a look? I can submit a PR to fix the native attributes that are not working.