You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Styled components seems not pass onTouchTap prop in basic tags #527
All anchor tag show alert message box after touchTap or click.
Actual Behavior
The first anchor tag not show alert.
Description
In this reproduction, seems only basic tags can not receive onTouchTap prop.
I am new to styled-components, so if there is something I lost, please tell me.
Thanks!
Looking into it, this is a non-standard event that is monkey patched into tags via react-tap-event-plugin. This is an interesting case, because by looking at the code, it seems like there is an (undocumented) API to add these events.
Activity
jacobp100 commentedon Feb 23, 2017
Looking into it, this is a non-standard event that is monkey patched into tags via react-tap-event-plugin. This is an interesting case, because by looking at the code, it seems like there is an (undocumented) API to add these events.
We filter out non-standard attributes for html elements. I think it would be wrong to add this to that list, and doing that wouldn't extend to other events injected in this way.
This is ultimately caused by the same underlying issue that is effecting #403.
If you need a (hacky) workaround, you can do the following,
ShinyLeee commentedon Feb 23, 2017
Thanks for your reply, I think the workaround is more suitable in this case after find out the reason.
jacobp100 commentedon Mar 1, 2017
Moving discussion to #439
plankguy commentedon Jun 2, 2018
I noticed that new React 16.4.0 pointer events aren't in the "non-standard attribute" regex mentioned above. Are there plans to add these in a future release?
The above work-around gets the job done, but i'd like to see built-in support.
quantizor commentedon Jun 2, 2018
plankguy commentedon Jun 3, 2018
@probablyup Done: #1790