Skip to content
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

Merged
merged 2 commits into from
Apr 12, 2018

Conversation

AlexKamaev
Copy link
Contributor

connected with DevExpress/testcafe#1956

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 51e86a2 have passed. See details:

_dispatchTextEvent (el, text) {
const name = browserUtils.isIE ? 'textinput' : 'textInput';

let event = null;
Copy link
Contributor

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 use TextEvent.DOM_INPUT_METHOD_KEYBOARD = 1?
  • '' specified the locale name. As I understand it should be the current locale name - navigator.language.

Copy link
Contributor Author

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);
});

Copy link
Contributor

@miherlosev miherlosev Apr 11, 2018

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.

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 5ab2923 have failed. See details:

@AlexKamaev
Copy link
Contributor Author

@testcafe-build-bot \retest

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 5ab2923 have passed. See details:

@AlexanderMoskovkin AlexanderMoskovkin merged commit 3570c73 into DevExpress:master Apr 12, 2018
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this pull request Feb 28, 2019
* [WIP]textInput event should be supported correctly

* fixes after review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants