Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are various ways to create arrows, including bordered ones.
This demo uses CSS
border
and placesArrow
insidePositioner
instead ofPopup
. This is recommended as it prevents it from being cut off ifPopup
is scrollable.The calculations to position the arrow correctly can get complex with small 1px or 2px differences, which the demo uses CSS variables for.
Floating UI has a rule that the layout box of the arrow should be a square with equal width and height, which this particular demo doesn't follow. However, the rule exists only for when the side axis flips from x to y or vice-versa, because the width or height of the arrow changing causes its position to be wrong on the very first update. However, this is rarely seen in practice when scrolling or resizing since more updates typically occur after the axis flip. Plus, given we likely don't want a popover or tooltip to flip its side axis when scrolling (which will be the case when #817 is merged), this won't be seen by default - if the side axis is only changed based on the available viewport width, it's unlikely for this to be seen in practice as well.
I also think we should make demos for SVG arrows.