-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
[Block] Query LoopAffects the Query Loop BlockAffects the Query Loop Block[Type] PerformanceRelated to performance effortsRelated to performance efforts
Description
Description
Usage of the useDisabled hook can result in infinite loops. I found this on the Post Template block where it disables the inputs of the none selected list items. It has a heavy impact on editor performance.
It seems like the listener here is doing attribute updates that trigger the same listener. See screenshots of the Call Stack below.
If I check the mutation record the function receives, it always has null for the previous tabIndex value. (could be unrelated)
Step-by-step reproduction instructions
I don't know if there's any preconditions about our setup that could trigger this. From a first look it seems like it should happen for anyone.
- Add a Query Loop block in the editor, with a block that has focusable elements (for example Post Excerpt).
- Set up the Query Loop so that there's more than 1 result.
- Run a performance recording with your browser's dev tools. Or put a breakpoint in the listener.
- See how the listener is triggering itself continuously.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress: Tested on both 5.9 and 6.0-RC1
Chrome: Version 101.0.4951.54 (Official Build) (64-bit)
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Not yet
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Block] Query LoopAffects the Query Loop BlockAffects the Query Loop Block[Type] PerformanceRelated to performance effortsRelated to performance efforts
Type
Fields
Give feedbackNo fields configured for issues without a type.


