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
I noticed that you are mapping state.target to e.currentTarget in usePress. Considering that e.target and e.currentTarget have different meaning in the native Event I was wondering what led to this design decision?
I also think that the PressEvent documentation could be a lot more clear here considering how easy it is to confuse one for the other. Right now the docs say that PressEvent.target is "The target element of the press event.", and I think this sounds more like the native target behaviour, where target is actually the element that was clicked on (a SVG element within a button for instance). I would be open to opening a PR where this is a bit more clear, but I wanted to hear your thoughts about this first.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I noticed that you are mapping
state.target
toe.currentTarget
in usePress. Considering thate.target
ande.currentTarget
have different meaning in the nativeEvent
I was wondering what led to this design decision?I also think that the
PressEvent
documentation could be a lot more clear here considering how easy it is to confuse one for the other. Right now the docs say thatPressEvent.target
is "The target element of the press event.", and I think this sounds more like the nativetarget
behaviour, wheretarget
is actually the element that was clicked on (a SVG element within a button for instance). I would be open to opening a PR where this is a bit more clear, but I wanted to hear your thoughts about this first.Beta Was this translation helpful? Give feedback.
All reactions