Skip to content

Watching clientX/clientY values as PROPS only work when mouse moves alongside the x-achsis #11934

Discussion options

You must be logged in to vote

You are misreading your own console logs.

  • The watchers in the child component run console.clear()
  • So the tables you see are from the component whose watch ran last.
  • You have two instances of the button component: one receives cx (so cy is undefined), one receives cy (so cx is undefined)
  • When you scroll horizontally, only cx changes, so only the button receiving cx will update, and log what you see on your screenshot - cy being undefined because you never passed a value to that button.
  • When you scroll vertically, the same happens but for the other button: that other button receives the new cy value and thus updates, but it doesn't receive cx, so it's undefined.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DevKame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants