Skip to content

Use keydown instead of keypress on Firefox.#3413

Merged
muxator merged 1 commit intoether:developfrom
mantaroh:develop
Jul 1, 2018
Merged

Use keydown instead of keypress on Firefox.#3413
muxator merged 1 commit intoether:developfrom
mantaroh:develop

Conversation

@mantaroh
Copy link
Copy Markdown
Contributor

This related with issue #3383.

Firefox will not fire the keypress when target key is the non-printable keys. (like Enter / Tab / Delete... etc) For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1440189.

This behavior is same as safari / chrome, So etherpad-lite will not need to special handling of these key when UA is Firefox. This PR will use keydown event when target key is no-printable keys.

@muxator
Copy link
Copy Markdown
Contributor

muxator commented Jun 28, 2018

Hi @Manta12, thanks for this PR.

I would like to confirm if this change would indeed be compatible with currently supported Firefox versions.
Before merging this, would you please check it on Firefox ESR 52 and 60 (if not already done)?

Ideally this should be a task for automated testing, or a QA team, but I am not sure we have someone in charge.

Thank you again.

@mantaroh
Copy link
Copy Markdown
Contributor Author

mantaroh commented Jul 1, 2018

Thanks muxator,

Sorry for late my reply.
Yes, I checked ESR, then I confirmed that I can handle to the non-printable key on ESR 52/60. (Tab / Delete / Alt+s ...etc)

Furthermore, this changes will not affect other UAs. (like Chrome/Safari..etc) I tried these browser just in case.

Thanks!

@muxator muxator merged commit 2be873e into ether:develop Jul 1, 2018
@muxator
Copy link
Copy Markdown
Contributor

muxator commented Jul 1, 2018

Merged, thanks.

Fixes #3383.

@muxator
Copy link
Copy Markdown
Contributor

muxator commented Jul 20, 2018

I just noted that this PR (merged in 2be873e) breaks the frontend tests (http://<yourhost>/tests/frontend/), because they were full of special cases that sent keypress when executed in Firefox:

    if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
      var evtType = "keypress";
    }else{
      var evtType = "keydown";
    }

Taking out the special check for Firefox goes back to 10097% success rate for frontend tests in Firefox 61 (when applying only over this change).

muxator pushed a commit that referenced this pull request Jul 21, 2018
This puts issue: #3383, PR: #3413 (Use keydown instead of keypress on Firefox)
directly on top of bacc37c, which is the last commit before fe08d2a
merged #3268 (getLineHTMLForExport - Fixes #2486 but breaks plugins).

This is necessary for showing that:

- bacc37c was passing client side tests on firefox
  Visit `http://<yourhost>/tests/frontend/` using firefox.

- 2be873e forgot to update the client side tests. You cannot test it since
  that commit was mad on top of other changes, hence this graft

- in this commit there are 20 failures with firefox:
  passes: 82 failures: 20 duration: 261.84s
muxator added a commit that referenced this pull request Jul 21, 2018
These changes make the frontend tests send keydown instead of keypress in
firefox, in accordance with #3413 (Use keydown instead of keypress on Firefox).

The percentage of passing frontend in Firefox 61 on this revision is 100%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants