Fix TypeError when Bootstrap is included in head#32024
Conversation
|
It would be useful having some tests mocking getjQuery or jquery in window object, so that the uncovered parts are covered. I'm struggling a bit with mocking these parts. EDIT: Oh I overlooked jquery.spec.js. The extensions should be already tested. EDIT 2: I will try, if it really solves the problem with TurboLink :) |
|
We still have the problem in event-handler.js, when calling getjQuery(). |
|
I would prefer a way like this: ff1fa49 |
e40ec93 to
9a25477
Compare
|
it seems something decreased the minimum coverage required |
|
Do you know, if coverage also includes I think, we should find a solution, that |
|
The coverage doesn't include the jQuery part. |
|
Okay, still not familiar enough with bootstrap codebase. I simply overlooked the |
| } | ||
|
|
||
| const onDOMContentLoaded = callback => { | ||
| if (document.readyState === 'loading') { |
There was a problem hiding this comment.
Just to confirm, this should work with defer too?
|
@tidusIO apart from my comment above, can you please make a CodePen with the scripts in |
|
Yes, I've replied your comment. I can, but probably not before Wednesday. |
|
NVM I tested it myself and it works as expected, thanks for the PR! |
head
|
Bad decision. Jquery plugins should be loaded in developer defined order: there is convention that this order is maintained by |
|
Rly like last comment. We works with sharepoint onprem, and have a problem there. SP have own event model, many usefull events trigered before DOMContentLoaded without access to jquery bootstrap plagins. We spand a time for only understand that plagins extend performed in postponed format. |
I've added waiting for domContentLoaded event before extending jQuery. That's one possible solution to be sure, that data attributes of body can be read.
Fixes #31202
Preview: https://deploy-preview-32024--twbs-bootstrap.netlify.app/