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

Safari becomes unresponsive when configuring layouts #8

Closed
jeffaglenn opened this issue Jul 10, 2018 · 4 comments
Closed

Safari becomes unresponsive when configuring layouts #8

jeffaglenn opened this issue Jul 10, 2018 · 4 comments
Assignees
Labels
Bug Report Something isn't working

Comments

@jeffaglenn
Copy link

Really weird issue of Safari using a ton of resources, becoming unresponsive, and basically crashing when organizing the spoon layouts. Used Chrome and everything was okay. Let me know if I can help diagnose this a little better.

@theskyfloor
Copy link

Same here.

@joshangell
Copy link
Contributor

Thanks chaps, seems I missed out looking at it when I did the port but it was an issue before: angell-co/Pimp-My-Matrix#30

I'll prioritise it!

@joshangell joshangell self-assigned this Jul 11, 2018
@joshangell joshangell added the Bug Report Something isn't working label Jul 11, 2018
@joshangell
Copy link
Contributor

joshangell commented Jul 11, 2018

OK, I have tracked this down to a possible issue inside the core Craft.Grid class, which has this innocuous line:

this.addListener(this.$container, 'resize', this.handleContainerHeightProxy);

For some reason when the Craft.FieldLayoutDesigner class is loaded inside a modal there are multiple resize events being added to the container in question, which causes an infinite loop.

Simply changing that line to the following does seem to fix it:

if ($.inArray(this.$container, this._listeners) === -1) {
    this.addListener(this.$container, 'resize', this.handleContainerHeightProxy);
}

I will PR the core repo, but it may have consequences I’m not aware of so it should be thought through further.

To clarify, this only happens in Safari because it seems other browsers throttle the infinite loop behaviour so as not to crash. It is technically happening in all browsers.

@joshangell joshangell changed the title Safari becomes unresponsive when using the plugin Safari becomes unresponsive when configuring layouts Jul 11, 2018
@joshangell
Copy link
Contributor

OK, small update on this one - its been fixed in the core, so when the next Craft release gets pushed I’ll double check it fixes our issue and cut a new release for Spoon.

Thanks for your patience!

joshangell added a commit that referenced this issue Jul 18, 2018
- Updated the README with the relevant [GitHub project](https://github.com/angell-co/Spoon/projects/2) and a note about support
- Changed the required version of Craft to 3.0.16 which fixes an issue with Safari when configuring block type layouts ([#8](#8))

- Fixed a typo in the README
- Fixed an issue where the initial page load in Safari was showing blank blocks ([#10](#10))

* tag '3.0.1':
  Version 3.0.1
  Added a note about supertable to the roadmap
  Fixed a typo in the README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants