fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Modal makes final form throw an exception

Open ilbrando opened this issue 5 years ago • 4 comments

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 avatar Jan 21 '21 09:01 ilbrando

@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:

image

However, during runValidation() safeFields is empty:

image

For me it's unclear why it happens. @joschect do you have any ideas?

layershifter avatar Jan 25 '21 15:01 layershifter

@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 avatar Jan 29 '21 10:01 ilbrando

@ilbrando v8 was released a month ago 🎉 https://github.com/microsoft/fluentui/wiki/Version-8-release-notes

layershifter avatar Mar 29 '21 10:03 layershifter

Closing for housekeeping. Feel free to re-open if the fix is still needed for v7.

layershifter avatar Dec 09 '21 13:12 layershifter