Skip to content

fix(Combobox): render the dropdown inline in the Plasmic canvas (MET-3088) - #63

Merged
Zayooo00 merged 1 commit into
mainfrom
fix/combobox-canvas-inline-menu
Aug 31, 2026
Merged

fix(Combobox): render the dropdown inline in the Plasmic canvas (MET-3088)#63
Zayooo00 merged 1 commit into
mainfrom
fix/combobox-canvas-inline-menu

Conversation

@Zayooo00

Copy link
Copy Markdown
Contributor

Follow-up to #62.

Problem

#62 moved the Combobox menu into a portal (Headless UI v2 anchor forces portal: true). The portal renders on document.body, outside the subtree Plasmic Studio can select or scope injected styles to — so in the canvas optionsClassName and every option-state style stopped applying, and Floating UI mispositioned the menu inside the scaled canvas iframe.

Change

Gate on the existing useInPlasmic() helper:

  • Canvas: <ComboboxOptions portal={false} style={{ position: "absolute", top: "100%", left: 0, zIndex: 1000 }}> — the menu renders inline just below the input, fully selectable and styleable.
  • Prod: unchanged — anchor={{ to: menuPlacement, gap: 1, padding: 8 }} + transition (portal, viewport flip/shift).

Only the positioning differs between the two paths; the classNames are identical, so what you style in Studio is what ships.

Positioning is an inline style (not a CSS-module class) so a bundler that doesn't re-process changed node_modules CSS can't drop it.

Verified

tsc -p tsconfig.package.json, next lint, vitest (49 pass) green. Tested locally against myevals-react-frontend in Plasmic Studio: menu renders inline under the input and optionsClassName / option-state edits now apply.

…3088)

Headless UI v2's `anchor` forces the options list into a portal on
`document.body`. That is outside the subtree the Plasmic design tool can
select or scope injected styles to, so `optionsClassName` (and every
option-state style) never reached the menu in Studio, and Floating UI
mispositioned it inside the scaled canvas.

Gate on `useInPlasmic()`: in the canvas render `<ComboboxOptions>` with
`portal: false` and an inline `position: absolute; top: 100%` so the menu
sits under the input, fully selectable and styleable. In prod keep
`anchor` + `transition` (portal, viewport flip/shift). Only the
positioning differs between the two paths; the classes are identical.
@notion-workspace

Copy link
Copy Markdown

@Zayooo00
Zayooo00 enabled auto-merge (squash) August 31, 2026 12:44
@Zayooo00
Zayooo00 disabled auto-merge August 31, 2026 12:45
@Zayooo00
Zayooo00 merged commit 53c6023 into main Aug 31, 2026
2 checks passed
@Zayooo00
Zayooo00 deleted the fix/combobox-canvas-inline-menu branch August 31, 2026 12:46
Zayooo00 added a commit to myevaluations/myevals-plasmic-utils that referenced this pull request Aug 31, 2026
…3088) (fullstackhouse#63) (#5)

Headless UI v2's `anchor` forces the options list into a portal on
`document.body`. That is outside the subtree the Plasmic design tool can
select or scope injected styles to, so `optionsClassName` (and every
option-state style) never reached the menu in Studio, and Floating UI
mispositioned it inside the scaled canvas.

Gate on `useInPlasmic()`: in the canvas render `<ComboboxOptions>` with
`portal: false` and an inline `position: absolute; top: 100%` so the menu
sits under the input, fully selectable and styleable. In prod keep
`anchor` + `transition` (portal, viewport flip/shift). Only the
positioning differs between the two paths; the classes are identical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants