floating-ui / popper.js.org

🍿🦉Website and Documentation for Popper and friends
https://popper.js.org
MIT License
74 stars 394 forks source link

Fix for tutorial #25

Closed chehrhar closed 3 years ago

chehrhar commented 3 years ago

When enabling the event listener in the show() function, the original options are overridden in the tutorial with new options. It took me some time to figure out why the originial options wouldn't have any effect. Instead, you should restore the originial options in the show() function.

EamonNerbonne commented 3 years ago

I just ran into the same issue; simply copy-pasting the tutorial example into codepen and hovering over the button demonstrates the lack of offset:

https://codepen.io/emn13/pen/BaZKWEX

FezVrasta commented 3 years ago

I updated the tutorial to use the new setOptions callback

EamonNerbonne commented 3 years ago

Great! It's clear now (to me anyhow, sample size 1 and all) what the sematics are.