-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add test where form
is descendant of element with stop propagation on click
#2309
Merged
mcansh
merged 4 commits into
remix-run:dev
from
penspinner:bug/ancestor-stop-propagation-button
May 8, 2022
Merged
test: add test where form
is descendant of element with stop propagation on click
#2309
mcansh
merged 4 commits into
remix-run:dev
from
penspinner:bug/ancestor-stop-propagation-button
May 8, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Related Discord thread with @ryanflorence: https://discord.com/channels/770287896669978684/950943922966900756. |
MichaelDeBoey
requested changes
Mar 13, 2022
penspinner
force-pushed
the
bug/ancestor-stop-propagation-button
branch
from
March 16, 2022 23:08
5a74dc8
to
67f771a
Compare
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
penspinner
force-pushed
the
bug/ancestor-stop-propagation-button
branch
2 times, most recently
from
March 16, 2022 23:46
d59968b
to
625cb9b
Compare
penspinner
changed the title
Bug/ancestor stop propagation button
bug: add failing test where descendant of element with stop propagation on click messing up submit button payload
Mar 16, 2022
penspinner
force-pushed
the
bug/ancestor-stop-propagation-button
branch
from
April 6, 2022 15:39
625cb9b
to
6f81c49
Compare
mcansh
changed the title
bug: add failing test where descendant of element with stop propagation on click messing up submit button payload
test: add test where descendant of element with stop propagation on click
May 8, 2022
mcansh
changed the title
test: add test where descendant of element with stop propagation on click
test: add test where form is descendant of element with stop propagation on click
May 8, 2022
Signed-off-by: Logan McAnsh <logan@mcan.sh>
mcansh
approved these changes
May 8, 2022
mcansh
changed the title
test: add test where form is descendant of element with stop propagation on click
test: add test where May 8, 2022
form
is descendant of element with stop propagation on click
christophertrudel
pushed a commit
to christophertrudel/remix
that referenced
this pull request
May 16, 2022
…ation on click (remix-run#2309) Co-authored-by: Logan McAnsh <logan@mcan.sh>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug
Added a failing test where clicking a submit button as a descendant of an element that stops propagation on click does not send the clicked submit button's
name
andvalue
properties to the action request payload.I think this bug was introduced from #1781 (released in v1.2.0) because this used to work until I updated dependencies at some point.
How I encountered this
I encountered this bug through my own app. I had a modal with a form in it, and it suddenly stopped sending
{ _action: add_note }
to my action's request payload. My code looks something like this:And I noticed Headless UI's Dialog has an
event.stopPropagation()
on the div'sonClick
: https://github.com/tailwindlabs/headlessui/blob/c4e35f38794b89ec9692e8bb7027447503623604/packages/%40headlessui-react/src/components/dialog/dialog.tsx#L318