Skip to content

[lexical-html] Bug Fix: Dispatch unrestricted CSS selector groups - #8873

Merged
etrepum merged 1 commit into
meta:mainfrom
winklemad:fix/css-selector-unrestricted-union
Jul 24, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
winklemad:fix/css-selector-unrestricted-union

Conversation

@winklemad

Copy link
Copy Markdown
Contributor

Description

Mixed tag-restricted and unrestricted selector lists passed to sel.css(...) were indexed only under their explicit tags. This meant an unrestricted group such as .foo was never evaluated for elements whose tag was not also listed.

This change uses wildcard dispatch whenever any selector group is unrestricted. The existing selector predicate still filters candidates, so each element must satisfy one of the original groups.

Test plan

Before

The focused regression assertion failed:

expected [ 'p' ] to deeply equal [ 'p', 'div' ]

After

  • Focused DOMImportExtension tests: 23/23 passed.
  • lexical-html unit tests: 89/89 passed.
  • pnpm run ci-check passed.

## Description

Fix selector-list dispatch metadata so a tag-restricted group does not prevent unrestricted groups from evaluating other elements.

## Test plan

### Before

The DOMImportExtension test failed for `p, .foo` because only the `<p>` reached the rule.

### After

The focused DOMImportExtension test, lexical-html unit suite, and `pnpm run ci-check` pass.
@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Jul 22, 2026 5:03pm
lexical-playground Ready Ready Preview Jul 22, 2026 5:03pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 22, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jul 22, 2026
@etrepum
etrepum added this pull request to the merge queue Jul 24, 2026
Merged via the queue into meta:main with commit e3e9d41 Jul 24, 2026
50 checks passed
@etrepum etrepum mentioned this pull request Jul 29, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — 33f77335 Deployed Jul 22, 2026 by vercel[bot]
Preview – lexical-playground — 33f77335 Deployed Jul 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants