Fix hotkeys triggering while editing properties panel values (#606) (#607)

* Fix hotkeys triggering while editing properties panel values (#606)

* Add properties panel inputs to key handler ignore

* Add properties panel test

* Update test expectations [skip ci]

---------

Co-authored-by: bymyself <abolkonsky.rem@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-08-23 16:46:40 -04:00
committed by GitHub
parent 92ce064ebf
commit 31d172d4d9
4 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './ComfyPage'
test.describe('Properties Panel', () => {
test('Can change property value', async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
await comfyPage.rightClickEmptyLatentNode()
await comfyPage.page.getByText('Properties Panel').click()
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
'right-click-node-properties-panel.png'
)
const propertyInput = comfyPage.page.locator('span.property_value').first()
// Ensure no keybinds are triggered while typing
await propertyInput.pressSequentially('abcdefghijklmnopqrstuvwxyz')
await expect(comfyPage.canvas).toHaveScreenshot(
'right-click-node-properties-panel-property-changed.png'
)
await propertyInput.fill('Empty Latent Image')
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
})
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -27,7 +27,12 @@ app.registerExtension({
}
const target = event.composedPath()[0]
if (['INPUT', 'TEXTAREA'].includes(target.tagName)) {
if (
target.tagName === 'TEXTAREA' ||
target.tagName === 'INPUT' ||
(target.tagName === 'SPAN' &&
target.classList.contains('property_value'))
) {
return
}