While trying to test #137 in the course planner[1], I wound up seeing a few dozen test failures that seemed to be related to the closing behavior of the modal. It seems that there were two issues:
Removing the evt.preventDefault() call on the Modal itself was causing some click events to register on the backdrop, closing the modal before it should have.
Defining the mouseDownOnModal field in the render function was causing it to revert to false when the component re-rendered, preventing the modal from closing when it should have.
At least, I think that's what was happening. I don't think either of those were really registering as issue when manually testing the browser, but I suspect something in the testing library click event handling was causing the unexpected behavior.
[1]: I tested this by first transpiling the code in mark-one with:
tsc --project=tsconfig.publish.json
Then copying the built files into my copy of course-planner:
Describe your changes
While trying to test #137 in the course planner[1], I wound up seeing a few dozen test failures that seemed to be related to the closing behavior of the modal. It seems that there were two issues:
evt.preventDefault()
call on the Modal itself was causing some click events to register on the backdrop, closing the modal before it should have.mouseDownOnModal
field in the render function was causing it to revert tofalse
when the component re-rendered, preventing the modal from closing when it should have.At least, I think that's what was happening. I don't think either of those were really registering as issue when manually testing the browser, but I suspect something in the testing library click event handling was causing the unexpected behavior.
[1]: I tested this by first transpiling the code in
mark-one
with:Then copying the built files into my copy of course-planner:
Types of changes
Checklist:
eslint
on the codePriority:
Related Issues:
Fixes #___