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
Initially, I tried popperModifiers={[offset(0)]}, but it had no effect, and the offset remained at 10. I began to worry if popperModifiers was functioning at all, so I tried specifying popperModifiers={[offset(10)]} out of curiosity. It then appeared as if the offset had increased to 20, which led me to realize that by applying -10, I could actually set the offset to 0.
I thought it might be helpful to share this here, in case anyone else encounters the same issue.
Could there be a smarter way to do this? Does anyone know?
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 was unsure how to accomplish this, but after some exploration, I found a solution.
It was as follows:
In version 6.1.0, it's doing
offset(10)
.https://github.com/Hacker0x01/react-datepicker/blob/v6.1.0/src/with_floating.jsx#L42
Initially, I tried
popperModifiers={[offset(0)]}
, but it had no effect, and the offset remained at 10. I began to worry ifpopperModifiers
was functioning at all, so I tried specifyingpopperModifiers={[offset(10)]}
out of curiosity. It then appeared as if the offset had increased to 20, which led me to realize that by applying -10, I could actually set the offset to 0.I thought it might be helpful to share this here, in case anyone else encounters the same issue.
Could there be a smarter way to do this? Does anyone know?
Beta Was this translation helpful? Give feedback.
All reactions