anvilistas / anvil-extras

Other
84 stars 25 forks source link

Popover without bootstrap #563

Closed s-cork closed 1 month ago

s-cork commented 1 month ago

This PR is a rewrite of the popover module There may come a day where anvil doesn't necessarily ship with bootstrap If that day came, then a user wouldn't be able to use the popver module if they opted out of bootstrap

This PR moves to using floating ui: https://floating-ui.com/ which is probably the way to go for this type of behaviour

I've tried to make it backwards compatible, but i suspect this rewrite might break someone's code, so it might want to be considered as a major version bump the classnames have changed for example, so anyone overriding the styling would break i've gone with prefix classnames like ae-popover so that we don't conflict with random css

I've tested it on the popover example app, as well as some weird edge cases we've seen in the forum before.

Note - i've deprecated the dismiss on scroll option as floating ui supports maintaining the popover position as the page is scrolled.