MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / trapClickOnNonInteractiveElement

Function trapClickOnNonInteractiveElement

code/styling/public/app.js:16118–16129  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

16116}
16117
16118function trapClickOnNonInteractiveElement(node) {
16119 // Mobile Safari does not fire properly bubble click events on
16120 // non-interactive elements, which means delegated click listeners do not
16121 // fire. The workaround for this bug involves attaching an empty click
16122 // listener on the target node.
16123 // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
16124 // Just set it using the onclick property so that we don't have to manage any
16125 // bookkeeping for it. Not sure if we need to clear it when the listener is
16126 // removed.
16127 // TODO: Only do this for the relevant Safaris maybe?
16128 node.onclick = emptyFunction;
16129}
16130
16131function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
16132 for (var propKey in nextProps) {

Callers 3

setInitialProperties$1Function · 0.70
diffProperties$1Function · 0.70
diffHydratedProperties$1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected