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

[FW][FIX] clipboard: don't open composer on firefox #2257

Closed
wants to merge 1 commit into from

Conversation

fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Mar 22, 2023

Steps to reproduce:

  • open a spreadsheet with firefox
  • copy a cell
  • paste it somewhere else => the composer is open with the pasted content.

Ok... that's weird, but not a big deal.
But it gets better:

  • copy multiple cells
  • paste them somewhere else => boom

The composer opens in the same way, but it doesn't support multiline text!

This commit fixes the composer opening and it also makes the edition plugin more robust by removing any carriage return that could slip through.

Additional small fix in the content editable helper, the selection start was not clipped if it was greater than the content length.

Note: it doesn't happen on Chrome because ev.data is null when pasting content. It doesn't correctly implements the spec
https://w3c.github.io/input-events/#dfn-data

opw-3236303

opw : 3236303

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_lt("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Forward-Port-Of: #2254
Forward-Port-Of: #2251

@robodoo
Copy link
Collaborator

robodoo commented Mar 22, 2023

@fw-bot
Copy link
Collaborator Author

fw-bot commented Mar 22, 2023

@LucasLefevre @rrahir cherrypicking of pull request #2251 failed.

stdout:

Auto-merging src/components/composer/content_editable_helper.ts
CONFLICT (content): Merge conflict in src/components/composer/content_editable_helper.ts
Auto-merging src/components/grid/grid.ts
Auto-merging src/plugins/ui_stateful/edition.ts
Auto-merging tests/components/composer.test.ts
Auto-merging tests/plugins/edition.test.ts

stderr:

09:48:29.310323 git.c:455               trace: built-in: git cherry-pick c5610392a565947e1b202890be64c39a8d4cb3fc
error: could not apply c5610392... [FIX] clipboard: don't open composer on firefox
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

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

robodoo r+

Steps to reproduce:
- open a spreadsheet with firefox
- copy a cell
- paste it somewhere else
=> the composer is open with the pasted content.

Additional small fix in the content editable helper, the selection `start`
was not clipped if it was greater than the content length.

Note: it doesn't happen on Chrome because `ev.data` is null when
pasting content. It doesn't correctly implements the spec
https://w3c.github.io/input-events/#dfn-data

opw-3236303

X-original-commit: c7f1486
@LucasLefevre LucasLefevre force-pushed the saas-16.2-15-paste-firefox-lul-VyQt-fw branch from 389d8b3 to 55b7b86 Compare March 27, 2023 08:06
@LucasLefevre
Copy link
Collaborator

robodoo r+

@robodoo robodoo closed this in 81e4b9e Mar 27, 2023
@robodoo robodoo temporarily deployed to merge March 27, 2023 08:19 Inactive
@fw-bot fw-bot deleted the saas-16.2-15-paste-firefox-lul-VyQt-fw branch April 10, 2023 08:47
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.

None yet

3 participants