-
Notifications
You must be signed in to change notification settings - Fork 162
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
textInput event should be supported correctly #1564
Conversation
✅ Tests for the commit 51e86a2 have passed. See details: |
_dispatchTextEvent (el, text) { | ||
const name = browserUtils.isIE ? 'textinput' : 'textInput'; | ||
|
||
let event = null; |
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.
Specification https://webplatform.github.io/docs/dom/TextEvent/initTextEvent.
Rewrite as
if (nativeMethods.WindowTextEvent && nativeMethods.documentCreateEvent) {
const event = nativeMethods.documentCreateEvent.call(document, 'TextEvent');
const textEventArgs = {
eventType: browserUtils.isIE ? 'textinput' : 'textInput',
...other parameters
};
event.initTextEvent(textEventArgs.eventType, ....);
return this._raiseDispatchEvent(el, event);
}
return null;
Also there are few questions about event.initTextEvent(name, true, true, null, text, 0, '')
parameters:
null
specified for window on which this event is occurring. Maybe it should be the current window instead of null?- 0 specified how text is entered. Now it equals
TextEvent.DOM_INPUT_METHOD_UNKNOWN = 0
. Maybe we should useTextEvent.DOM_INPUT_METHOD_KEYBOARD = 1
? - '' specified the locale name. As I understand it should be the current locale name -
navigator.language
.
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.
I agree
@@ -674,3 +674,26 @@ test('wrong type of the blur event (GH-947)', function () { | |||
eventSimulator.blur(domElement); | |||
ok(raised); | |||
}); | |||
|
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.
Add comment that firefox does not support textInput
event.
Rename test to text input
and place it right after the drag and drop events
test.
❌ Tests for the commit 5ab2923 have failed. See details: |
@testcafe-build-bot \retest |
✅ Tests for the commit 5ab2923 have passed. See details: |
* [WIP]textInput event should be supported correctly * fixes after review
connected with DevExpress/testcafe#1956