oddbird / oddbird/css-anchor-positioning

Batch DOM checks for fallback positions

Open
#227 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
493
Forks
18
Avg merge
12h 37m
Merged PRs (30d)
5

Description

Per @mmalerba -

"I'm not very familiar with @floating-ui/dom, maybe its doing some intelligent batching already, but if not, its something we could consider doing manually. i.e. add the styles for a new candidate position for every target and then check the overflow of all of them at once, repeat the process for any that don't have a match yet"

https://github.com/oddbird/css-anchor-positioning/pull/202#discussion_r1695787685

This seems like a potential for improved performance, especially when there are multiple anchored elements with position fallback.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the discussion in pull request #202 and inspect how @floating-ui/dom currently handles fallback-position checks for multiple anchored elements. Determine whether batching is absent and define a performance comparison for pages with multiple anchored elements; done means the behavior remains correct while the repeated DOM checks are measurably reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.