Skip to content

Blocks Overlapping Eachother in Editor on Firefox #19476

Closed

Description

@tomjn

Describe the bug

When adding new blocks in Firefox 71 they appear overlapping existings blocks. This behaviour was not encountered in Safari when tested on MacOS Catalina.

The blocks don't push the next block out of the way and appear on top of eachother. I've replicated this using private blocks in a client project, and in frontenberg with the latest gutenberg

Of note this doesn't happen with paragraph blocks and bullet lists, but does happen with columns, and sometimes it jumps to the correct layout

To reproduce
Steps to reproduce the behavior:

  1. Add a block or blocks
  2. Observe overlapping

Expected behavior
I expect behaviour to match behaviour in Safari as is normal for block insertion

Screenshots

https://youtu.be/6RQpVWZvFc0

Screenshot 2020-01-07 at 15 16 23

Desktop (please complete the following information):

  • OS: MacOS Catalina
  • Browser Firefox
  • Version 71

Additional context

  • Gutenberg 7.1, and stock WP 5.3

Activity

  1. iniOr commented on Feb 2, 2020

    @iniOr

    Same issue here on FF 72.0.4, what a mess.

    26 days later no comments no news on when this will be fixed ?

  2. talldan commented on Feb 5, 2020

    @talldan
    Contributor

    Hi @tomjn @iniOr - apologies for the amount of time responding, there's a bit of a backlog of new issues that I'm trying to triage.

    I couldn't reproduce this issue in Firefox 72 using Gutenberg 7.1, though I am still on Mojave (and not quite ready to upgrade yet).

    It does feel like there'd be a huge number of reports of this issue. Anything unique about your environments that you can think of that might help with a reproduction? Browser add-ons?

  3. noisysocks commented on Feb 5, 2020

    @noisysocks
    Member

    I can’t reproduce this using Firefox 71 on Catalina. I followed the steps in the video and used https://frontenberg.tomjn.com/. There was a brief flash where it looked like the Columns block overlapped the List block, but then everything was fine.

  4. iniOr commented on Feb 6, 2020

    @iniOr

    Just got the issue using the latest version of Firefox 72.0.2 on Linux Mint 19.3

    Screenshot from 2020-02-06 13-02-06

    On the screenshot you can clearly see tag cloud block overlapping latest posts block.

    Currently editing a page with this bug is really hard.

    Just tested with Firefox 72.0.2 on WIndows 10 and i can't reproduce the issue.

  5. iniOr commented on Feb 7, 2020

    @iniOr

    Seems that using one the following Firefox addons may be the cause of this issue :

    -Ublock Origin
    -Privacy Badger

    What I don't understand is that Gutenberg works with no issue on Windows with those extensions enabled.

    Disabling them on Linux mint 19.3 fixes the problem for me.

    EDIT : after some usage the issue comes back, even with previously mentioned add-ons disabled.

  6. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    I still get this with latest Gutenberg and the latest Firefox:

    Screenshot 2020-03-09 at 12 49 39

    Screenshot 2020-03-09 at 13 14 36

    The thing is initially it behaves as expected, but you have to interact and insert blocks to reproduce it. I don't believe the instructions to reproduce are reliable, there is something else going on that's needed and i haven't identified how. I just know that pretty much all attempts to use the block editor in Firefox eventually lead to this problem. Using images and custom blocks seem to reproduce this easier than using paragraphs. Paragraphs themselves only show the issue in the context of other non-paragraph blocks

  7. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    Of note, saving as a draft and re-loading the page shows the blocks as they're meant to be shown, and I can interact with them fine:

    Screenshot 2020-03-09 at 13 18 58

    The problem reappears when I try to insert a block though. I used the inserter to add a heading between the two images, and it showed normally for a brief moment then dissapeared behind the block underneath. It shows normally when I type in the block but then reverts back to the overlapping behaviour:

    https://www.youtube.com/watch?v=2jOGygMf6b4

    Screenshot 2020-03-09 at 13 24 26

  8. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    If the heading block is removed, a gap appears inbetween the 2 image blocks.

    I believe a contributor to this issue is a transform CSS parameter being applied to the next block element:

    Screenshot 2020-03-09 at 13 27 47

    For whatever reason, every block after the heading has the same -108px transform:

    Screenshot 2020-03-09 at 13 29 36

  9. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    I also managed to reproduce this bug by using the mover controls. The block does not move when using the arrows, and subsequent clicks causes more overlapping, gaps, and confusion:

    Screenshot 2020-03-09 at 13 38 53

    Screenshot 2020-03-09 at 13 38 59

    Here's another recording:

    https://www.youtube.com/watch?v=FxxlG2d0yf0

    I would also note that between this comment and the previous comment, I turned on reduce motion in system preferences, and closed/reopened Firefox. This was based on a hunch that this is related to block movement animations. I suspected this because I could find only one case of translate3d in a github search which referenced animation of blocks when moving them, and the checking of motion preferences in packages/block-editor/src/components/block-list/moving-animation.js

    This is all in 73.0.1 (64-bit) on Catalina 10.15.3 (19D76), Gutenberg Version 7.6.0 with the WP beta tester plugin active and updated to today ( March 9th ). I get similar results in other WP installs with varying combinations of 5.3 + GB. I have duck duck go privacy installed and decentraleyes, turning them off does not resolve the problem

  10. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    It also seems that window.matchMedia('(prefers-reduced-motion: reduce)') returns false for me despite it being turned on at the OS level when using Firefox 73 :/ I can't find a way to force the block editor to behave as if it's set via the console to test this theory

  11. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    The problem is eliminated when adding this CSS rule:

    .wp-block {
        transform: none !important;
    }

    With this in place, block movement is instantaenous and I can no longer reproduce the issue. My suspicion is that it begins an animation when a block moves or is inserted/removed, but because the animation is implemented in JS rather than CSS, and the animation never "ticks", it gets stuck on the first frame. I'm unsure why this is the case in Firefox but not Chrome/Safari

  12. tomjn commented on Mar 9, 2020

    @tomjn
    ContributorAuthor

    I have found the source of the problem

    The react-spring library does not work when privacy.resistFingerprinting is set to true in about:config. Here is the relevant issue:

    pmndrs/react-spring#664

    react-spring is being used for block movement animations, hence why blocks are overlapping, and why animations never happen, they begin but cannot progress.

    Turning off the privacy fingerprinting resist option resolve the issue

  13. added
    [Type] BugAn existing feature does not function as intended
    and removed
    Needs TestingNeeds further testing to be confirmed.
    on Mar 9, 2020
  14. 1 remaining item

  15. tomjn commented on Mar 18, 2020

    @tomjn
    ContributorAuthor

    I'd be happy if we could just force animations off regardless of reduce motion preferences. As great as having our cake and eating it would be, privacy > animations. Perhaps a checkbox in the options panel

  16. youknowriad commented on Mar 18, 2020

    @youknowriad
    Contributor

    @tomjn Agreed, this is tracked here #16354

  17. paaljoachim commented on Apr 15, 2021

    @paaljoachim
    Contributor

    Hey @tomjn Tom is this issue still valid?

  18. tomjn commented on Apr 15, 2021

    @tomjn
    ContributorAuthor
  19. FlyingDR commented on Apr 15, 2021

    @FlyingDR

    @paaljoachim Issue is reproducible in WordPress 5.7. Firefox Developer Edition 89.0b9 on Windows 7.

    Steps to reproduce: Copy / paste several paragraphs of text (from lipsum.com in my case) and move them up / down using block moving controls. Result can be seen below:

    image

    Toggling of privacy.resistFingerprinting in about:config immediately recovers blocks appearance.

  20. paaljoachim commented on Apr 15, 2021

    @paaljoachim
    Contributor

    Ugh...not good... Hopefully someone can pick it up and fix it.
    Thanks for testing @FlyingDR Alexander!

  21. FlyingDR commented on Apr 16, 2021

    @FlyingDR

    @paaljoachim There is interesting nuance that can only be seen in action so I've recorded small video, see below.

    Please notice that as soon as privacy.resistFingerprinting setting is turned off - all stuck animations are automatically get resumed and played till the end.

    So probably the only thing that is required for the fix is to detect fingerprint resistance and either disable animations or find out what prevents them from completion. It is also possible to submit bugreport with request for comments from Mozilla engineers.

    wordpress-gutenberg

  22. mcsf commented on Apr 16, 2021

    @mcsf
    Contributor

    Seems to be fixed in react-spring as of v9rc3, so it should be a matter of upgrading that dependency in Gutenberg, if someone is interested.

  23. paaljoachim commented on Apr 16, 2021

    @paaljoachim
    Contributor

    Perhaps @gwwar Kerry is able to check it out later on.

  24. gwwar commented on Apr 19, 2021

    @gwwar
    Contributor

    Yes, this is still an issue. Tested on OSX/FF88:

    overlap.mp4
  25. gwwar commented on Apr 19, 2021

    @gwwar
    Contributor

    I'm at EOD but here's a quick draft PR of the dep update: #30979

  26. gwwar commented on Jul 14, 2021

    @gwwar
    Contributor

    🙈 So when privacy.resistFingerprinting is true FF will reduce the JavaScript time precision to 100 ms!

    For context, animations need 16ms frames to achieve 60 frames per second. So a resolution of 100ms is going to do really funny things with any sort of animation, regardless of what framework we're using.

    In Firefox, you can also enable privacy.resistFingerprinting — this changes the precision to 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger.

    https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#reduced_time_precision

    We might need to test if we need to add the following headers to enable higher precision:

    Cross-Origin-Opener-Policy: same-origin
    Cross-Origin-Embedder-Policy: require-corp

  27. tomjn commented on Jul 14, 2021

    @tomjn
    ContributorAuthor

    For those unaware, the last comment makes more sense after reading this:

    #30979 (comment)

  28. gwwar commented on Sep 15, 2021

    @gwwar
    Contributor

    This one should be fixed by #30979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions