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

[FIX] web_editor: fix summernote text drop on firefox #42470

Conversation

jvnm-dev
Copy link

Issue

- Have firefox
- Go to any chatter
- Open full editor
- Write some "test" words with line breaks
- Select one of your "test" words
- Drag & drop it somewhere else in the editor

Welcome on test.com! (redirected)

Cause

Summernote doesn't preventDefault on drop event, so firefox
think we want to go to another URL.

Solution

Add the preventDefault manually.

This reveals another issue which is solved by importing
this PR's code https://github.com/summernote/summernote/pull/3327
(with adaptation for our dinosaurus version)

OPW-2158112

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@jvnm-dev
Copy link
Author

@nle-odoo What do you think?

@robodoo robodoo added seen 🙂 CI 🤖 Robodoo has seen passing statuses labels Dec 30, 2019
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Dec 30, 2019
Copy link
Contributor

@nle-odoo nle-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, we normally try to avoid fix in external library but since it's an adapted backport of the current version, that might be alright

The e.preventDefault is not in the linked version of summernote, isn't what they did:

summernote/summernote@d8e9e95

enough to make it work?

it seems a little odd to prevent default on the whole document, I think it's possible to have another zone on the page where we would not want to prevent default.

robodoo delegate+

@nle-odoo
Copy link
Contributor

also I used to put around the code I changed in the library:

/* ODOO: (start_modification */
... the code I'm adding or modifying
/* ODOO: end_modification) */

so when we update it it's a little easier to understand where we changed things, but I don't think we are going to update from this version.

@jvnm-dev jvnm-dev force-pushed the 12.0-opw-2158112-fix-summernote-firefox-text-drop-jvm branch from 76a27e3 to 70e5e85 Compare December 30, 2019 13:35
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Dec 30, 2019
@jvnm-dev jvnm-dev force-pushed the 12.0-opw-2158112-fix-summernote-firefox-text-drop-jvm branch from 70e5e85 to d593ed0 Compare December 30, 2019 13:36
@jvnm-dev
Copy link
Author

jvnm-dev commented Dec 30, 2019

Indeed, it's better to do it only for the dropzone event! I added the comments, just in case.

Issue

    - Have firefox
    - Go to any chatter
    - Open full editor
    - Write some "test" words with line breaks
    - Select one of your "test" words
    - Drag & drop it somewhere else in the editor

    Welcome on test.com! (redirected)

Cause

    Summernote doesn't preventDefault on drop event, so firefox
    think we want to go to another URL.

Solution

    Add the preventDefault manually.

    This reveals another issue which is solved by importing
    this PR's code summernote/summernote#3327
    (with adaptation for our dinosaurus version)

OPW-2158112
@jvnm-dev jvnm-dev force-pushed the 12.0-opw-2158112-fix-summernote-firefox-text-drop-jvm branch from d593ed0 to a4eae93 Compare December 30, 2019 13:39
@robodoo robodoo removed the r+ 👌 label Dec 30, 2019
@jvnm-dev
Copy link
Author

robodoo r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Dec 30, 2019
robodoo pushed a commit that referenced this pull request Dec 30, 2019
Issue

    - Have firefox
    - Go to any chatter
    - Open full editor
    - Write some "test" words with line breaks
    - Select one of your "test" words
    - Drag & drop it somewhere else in the editor

    Welcome on test.com! (redirected)

Cause

    Summernote doesn't preventDefault on drop event, so firefox
    think we want to go to another URL.

Solution

    Add the preventDefault manually.

    This reveals another issue which is solved by importing
    this PR's code summernote/summernote#3327
    (with adaptation for our dinosaurus version)

OPW-2158112

closes #42470

Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
@robodoo robodoo closed this Dec 30, 2019
@robodoo robodoo temporarily deployed to merge December 30, 2019 14:50 Inactive
@nle-odoo nle-odoo deleted the 12.0-opw-2158112-fix-summernote-firefox-text-drop-jvm branch December 30, 2019 15:03
@fw-bot
Copy link
Contributor

fw-bot commented Jan 10, 2020

This pull request has forward-port PRs awaiting action (not merged or closed): #42755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants