Compare commits

...

6 Commits

Author SHA1 Message Date
Christian Byrne
026e47c523 Merge branch 'main' into fix/label-overlap 2026-03-25 21:15:09 -07:00
bymyself
82905f4da5 fix: use inset-x-0 instead of top-0 left-0 w-full for label positioning
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10034#discussion_r2950842585
2026-03-24 12:24:52 -07:00
bymyself
2fd8be90cf fix: use textarea.labels for deterministic label lookup in test 2026-03-24 12:24:14 -07:00
GitHub Action
83e685b0fc [automated] Apply ESLint and Oxfmt fixes 2026-03-24 12:24:14 -07:00
bymyself
2941615e45 fix: add background to textarea label to prevent text overlap on scroll
Give the textarea label a solid background color, full width, and
rounded top corners so that scrolled text content is masked behind
the label instead of showing through it.
2026-03-24 12:24:14 -07:00
bymyself
34f825a584 test: add failing test for textarea label overlap on scroll
The label in WidgetTextarea lacks a background color, causing scrolled
text content to show through the label. This test verifies the label
has a solid background to prevent this overlap.
2026-03-24 12:24:14 -07:00
2 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
import {
comfyExpect as expect,
comfyPageFixture as test
} from '../../../../fixtures/ComfyPage'
import type { ComfyPage } from '../../../../fixtures/ComfyPage'
test.describe('Textarea label overlap', { tag: ['@widget'] }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
await comfyPage.vueNodes.waitForNodes()
})
const getFirstClipNode = (comfyPage: ComfyPage) =>
comfyPage.vueNodes.getNodeByTitle('CLIP Text Encode (Prompt)').first()
const getTextarea = (comfyPage: ComfyPage) =>
getFirstClipNode(comfyPage).getByRole('textbox', { name: 'text' })
test('label should have a background color to prevent text showing through when scrolled', async ({
comfyPage
}) => {
const textarea = getTextarea(comfyPage)
// Fill with enough lines to cause scrollable content
const manyLines = Array.from(
{ length: 20 },
(_, i) => `Line ${i + 1}`
).join('\n')
await textarea.fill(manyLines)
// The label associated with this textarea must have a non-transparent
// background so scrolled text does not show through it.
const bgColor = await textarea.evaluate((el) => {
const label = (el as HTMLTextAreaElement).labels?.[0]
return label ? getComputedStyle(label).backgroundColor : ''
})
// 'transparent' or 'rgba(0, 0, 0, 0)' means no background — the bug.
expect(
bgColor !== 'transparent' && bgColor !== 'rgba(0, 0, 0, 0)',
`Expected label to have a solid background color, but got "${bgColor}"`
).toBe(true)
})
})

View File

@@ -10,7 +10,7 @@
<label
v-if="!hideLayoutField"
:for="id"
class="pointer-events-none absolute top-1.5 left-3 z-10 text-xxs text-muted-foreground"
class="pointer-events-none absolute inset-x-0 top-0 z-10 rounded-t-lg bg-component-node-widget-background px-3 pt-1.5 pb-0.5 text-xxs text-muted-foreground"
>
{{ displayName }}
</label>