-
Notifications
You must be signed in to change notification settings - Fork 669
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
Cannot type into ProseMirror editor with placeholder #2205
Comments
Hi @tamlyn, I have refactored your code in the repo (see the PR). |
Hi @tamlyn @hdorgeval <div class="placeholder ProseMirror-widget" contenteditable="false">Type here...</div> When testcafe performs the type action, it checks an element's 'contenteditable' attribute. For this reason, it does not work as expected. test('empty editor with placeholder', async t => {
const selector = Selector('#with-placeholder div[contenteditable]');
await t
await typeTextInEditor(selector, "Hello World", t);
await t.expect(selector.innerText).contains('Hello');
})
async function typeTextInEditor(selector, text, t) {
await goToEditMode(selector.find('p'));
await t.typeText(selector, text, { replace : true });
}
const goToEditMode = ClientFunction(selector => {
selector().innerHTML += '_';
}); In this case, we update the element's inner text in this function: goToEditMode function and the Prose editor removes div with the contenteditable='false' attribute, so that you can use our type action. |
Thank you both for the rapid response and suggested workarounds. I don't think reaching into the DOM and manipulating |
I noticed yesterday that just appending an empty string to
|
To hide a placeholder, it's required to click on the selector before typing. test('empty editor with placeholder', async t => {
const selector = Selector('#with-placeholder div[contenteditable]');
await t
await t.click(selector);
await t.typeText(selector, 'Hellow world', { replace : true });
await t.expect(selector.innerText).contains('Hello');
}) After the click placeholder is hidden as expected, however the test failed, so this behavior is incorrect and should be fixed. |
…d with contenteditable=false (DevExpress#2205)_
…d with contenteditable=false (DevExpress#2205)_
…d with contenteditable=false (DevExpress#2205)
…d with contenteditable=false (DevExpress#2205)
…d with contenteditable=false (DevExpress#2205)
…d with contenteditable=false (DevExpress#2205)
…d with contenteditable=false (closes DevExpress#2205)
…d with contenteditable=false (closes DevExpress#2205)
…d with contenteditable=false(closes DevExpress#2205)
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
…h contenteditable=false (DevExpress#2205) (DevExpress#2222) * [WIP]Should type in contenteditable div even if it has invisible child with contenteditable=false(closes DevExpress#2205) * add one more test case * fix tests on safari osx * fix changes after request * fixes after review * refactoring
Are you requesting a feature or reporting a bug?
Bug
What is the current behavior?
Using
typeText
in an editor with a placeholder doesn't work (no text is entered).What is the expected behavior?
Manually interacting with the editor works as expected and I would expect TestCafe to behave the same.
How would you reproduce the current behavior (if this is a bug)?
Here's a repro repo https://github.com/tamlyn/prosecafe
Specify your
The text was updated successfully, but these errors were encountered: