Flags can be cut off in small containers and viewports. In general, we should attempt to catch these cases, and flip the flag. We will probably need to flip up-down and left-right, depending on the collisions we find.
We may also allow the consumer to provide a "container" element, against whose bounds we check the flag (presumably defaulting to <body>?).
Note that the Quill tooltip already addresses this issue, so perhaps we can read across that solution (or something very similar).
First raised in https://github.com/reedsy/quill-cursors/pull/51
Flags can be cut off in small containers and viewports. In general, we should attempt to catch these cases, and flip the flag. We will probably need to flip up-down and left-right, depending on the collisions we find.
We may also allow the consumer to provide a "container" element, against whose bounds we check the flag (presumably defaulting to
<body>
?).Note that the Quill tooltip already addresses this issue, so perhaps we can read across that solution (or something very similar).