-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: focus editor only after it is ready #7235
Changes from 19 commits
3abaf85
cfb7887
b128cc2
fe49083
727a168
83081e5
f180f2b
7a7ba81
80b35d7
0df8bde
1c27e3b
558ae39
774cb53
750fe4e
bde29e2
d82353d
44c453a
c3136e9
74277ad
8ea9a52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,13 @@ import { | |
fixtureSync, | ||
focusin, | ||
focusout, | ||
isFirefox, | ||
keyDownChar, | ||
nextFrame, | ||
nextRender, | ||
space, | ||
} from '@vaadin/testing-helpers'; | ||
import { sendKeys } from '@web/test-runner-commands'; | ||
import sinon from 'sinon'; | ||
import { createItems, dblclick, flushGrid, getCellEditor, getContainerCell, onceOpened } from './helpers.js'; | ||
|
||
|
@@ -97,8 +99,9 @@ describe('edit column editor type', () => { | |
expect(checkbox.checked).to.be.equal(grid.items[0].married); | ||
}); | ||
|
||
it('should set focus-ring on the checkbox', () => { | ||
it('should set focus-ring on the checkbox', async () => { | ||
dblclick(cell._content); | ||
await nextFrame(); | ||
checkbox = column._getEditorComponent(cell); | ||
expect(checkbox.hasAttribute('focus-ring')).to.be.true; | ||
}); | ||
|
@@ -362,5 +365,16 @@ describe('edit column editor type', () => { | |
editor = column._getEditorComponent(cell); | ||
expect(editor).to.be.not.ok; | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New test fails here with Firefox, works locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have tried the fix manually for both Lit and Polymer, using all supported browsers on MacOS, Windows, and Android. The issue does not seem to be re reproducible in any of them. |
||
(isFirefox ? it.skip : it)('should not start edit with first character selected', async () => { | ||
column = grid.querySelector('[path="name"]'); | ||
cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); | ||
cell.focus(); | ||
await sendKeys({ down: 'a' }); | ||
ugur-vaadin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
await nextFrame(); | ||
ugur-vaadin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
await sendKeys({ down: 'b' }); | ||
await sendKeys({ down: 'Enter' }); | ||
expect(cell._content.textContent).to.equal('ab'); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary because of the timing changes.