Skip to content

[Live] Fixing bug with data-action="live#update" and inside clickable elements #950

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

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

weaverryan
Copy link
Member

Q A
Bug fix? yes
New feature? no
Tickets None
License MIT

Small bug fix:

<a
    data-action="live#update"
    data-model="name"
    data-value="Dan"
><span>Change name to Dan</span></a>

In this case, the "click" would actually happen on the span, which is event.target. Switched to event.currentTarget to get the element that the listener is actually attached to (the a).

Cheers!

@weaverryan weaverryan merged commit c669f92 into symfony:2.x Jun 16, 2023
@weaverryan weaverryan deleted the live-bug-current-target branch June 16, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant