Modal makes final form throw an exception
Environment Information
- @fluentui/react: 7.156.0
- final-form: 4.20.1
- react-final-form: 6.5.2
Please provide a reproduction of the bug in a codepen:
Code sandbox: https://codesandbox.io/s/summer-cookies-rb6l0?file=/src/App.tsx
When placing the Field component in a Modal, final form throws an exception: final-form.es.js:188 Uncaught (in promise) TypeError: Cannot read property 'active' of undefined Using the same Field component without a Modal works as expected.
Actual behavior:
Throws exception.
Expected behavior:
No errors.
Priorities and help requested:
Yes if I can,
Requested priority: High
Products/sites affected: (if applicable)
@ilbrando thanks for reporting, with v8 it works as expected: https://codesandbox.io/s/musing-jennings-9pq36
I was able to reproduce it with v7 only when validate is an async function, during React rendering it works as expected:

However, during runValidation() safeFields is empty:

For me it's unclear why it happens. @joschect do you have any ideas?
@layershifter Thank you for your response. When I run the link you provided with the version 8 package I still get the same error? But if it is solved in version 8 it might be ok for us to wait for that. Do you know when it is expected to be released?
@ilbrando v8 was released a month ago 🎉 https://github.com/microsoft/fluentui/wiki/Version-8-release-notes
Closing for housekeeping. Feel free to re-open if the fix is still needed for v7.