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

Breaks JS on frontend in IE11 #3

Open
adrianbj opened this issue Apr 6, 2019 · 2 comments
Open

Breaks JS on frontend in IE11 #3

adrianbj opened this issue Apr 6, 2019 · 2 comments

Comments

@adrianbj
Copy link

adrianbj commented Apr 6, 2019

Hey @BernhardBaumrock - this line:

"<script>document.dispatchEvent(new Event('DOMReady'))</script></body>",

gets output on the frontend of your site and breaks other JS in IE11.

Surely this should be limited to the backend and instances where RockGrid is actually displayed? Also, I expect it will break the PW in the backend on IE11 as well.

Let me know if you need any other info.

@BernhardBaumrock
Copy link
Owner

BernhardBaumrock commented Apr 8, 2019

Thank you @adrianbj for reporting this!
Of course you are right that it should only be injected when a RockGrid is displayed somewhere on the page. I know that this does not work properly yet. I think some other files are also loaded even when no RockGrid is loaded. I think this happened because it's sometimes tricky to have all files in place when things are requested via AJAX, but not sure any more.
No idea about IE11. I don't need to support IE11 on my running installations and for the future I think I will use RockTabulator. I want to give it a try soon and see how it goes. This could also replace my HandsonTable field that is not MIT any more from version 7 on: https://processwire.com/talk/topic/16608-fieldtypehandsontable-excel-like-inputfield/?do=findComment&comment=183295

A quickfix would be to simply make the hook only load in the pw admin:

    $this->wire->addHookAfter('Page(template=admin)::render', function($event) {
      ...
    });

I think it would not really be a problem to drop "support" of RockGrid in the frontend. I don't know of anybody that has ever used it on the frontend. Some plugins that I've created even don't work on the frontend - I didn't have the need and time to support it.

@adrianbj
Copy link
Author

adrianbj commented Apr 8, 2019

Yeah, that would probably be fine - I don't think backend code needs to support IE11, but the problem is that until Microsoft ports Edge to Windows 7 (which is coming), any code that completely halts execution of JS scripts (like that use of dispatchEvent does), needs to not be run on the frontend.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants