Skip to content

OUT-3480: prevent layout shift when inserting dynamic field in template title#1170

Merged
SandipBajracharya merged 1 commit intofeature/template-dynamic-fieldsfrom
OUT-3480
Mar 30, 2026
Merged

OUT-3480: prevent layout shift when inserting dynamic field in template title#1170
SandipBajracharya merged 1 commit intofeature/template-dynamic-fieldsfrom
OUT-3480

Conversation

@SandipBajracharya
Copy link
Copy Markdown
Collaborator

@SandipBajracharya SandipBajracharya commented Mar 30, 2026

Summary

  • The autofill chip renders inside an inline-flex node view. Its border (1px top + 1px bottom) causes the flex item's box to exceed the paragraph line-height, expanding the line box by 2px on every chip insertion.

  • Replace the chip's border with an outline scoped to the title editor context. Outline is cosmetically identical (same color, follows border-radius in modern browsers) but has no effect on layout, eliminating the shift without changing the chip's size or padding.

Testing Criteria

Loom

…emplate title

The autofill chip renders inside an inline-flex node view. Its border (1px top
+ 1px bottom) causes the flex item's box to exceed the paragraph line-height,
expanding the line box by 2px on every chip insertion.

Replace the chip's border with an outline scoped to the title editor context.
Outline is cosmetically identical (same color, follows border-radius in modern
browsers) but has no effect on layout, eliminating the shift without changing
the chip's size or padding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Mar 30, 2026

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview, Comment Mar 30, 2026 9:38am

Request Review

Copy link
Copy Markdown
Collaborator

@priosshrsth priosshrsth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if setting box-sizing to border-box or something would have solved the issue. But if it solves the issue, I am not against it.

@SandipBajracharya
Copy link
Copy Markdown
Collaborator Author

I wonder if setting box-sizing to border-box or something would have solved the issue. But if it solves the issue, I am not against it.

border-box requires explicit height. In our case we should have height = line-height. Since line height is dynamic (sent as props in component), the current approach would be simpler

@SandipBajracharya SandipBajracharya merged commit 1fea068 into feature/template-dynamic-fields Mar 30, 2026
4 checks passed
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