-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Reverse #22138 and detach accordion from card without requiring 'data-children' #22251
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f12a613
Reverse 099486f
pvdlg 77bccf7
Reverse fa1504e
pvdlg 4f37ad2
Revert "Add unit test"
pvdlg ed6fd20
Reverse #22138 and detache accordion from card without requiring 'dat…
pvdlg 243f253
Also test closing the second item in the accordion
pvdlg 712c09f
Add unit test for nested accordion
pvdlg 9e5ed39
Merge branch 'v4-dev' into fix-collapse-no-card
pvdlg dd30c4d
Merge branch 'v4-dev' into fix-collapse-no-card
pvdlg 489d8fc
Merge branch 'v4-dev' into fix-collapse-no-card
pvdlg af6c9ee
Merge branch 'v4-dev' into fix-collapse-no-card
pvdlg 276018c
Merge branch 'v4-dev' into fix-collapse-no-card
pvdlg 253d6e0
Merge branch 'v4-dev' into fix-collapse-no-card
Johann-S File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is better or not, but you do a double find of children instead of one. So if they are a huge collapse it wont be fast as the previous PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
find()
method in JQuery go through the whole tree of child (life child, grand-child, grand-grand-child).The
children()
go through only one level. So 2 calls tochildren()
will most likely be faster thanfind()
in case there is content in the.collapse
(that would be more than 2 level). Most likely there would be content in the.collapse
.In addition calling
children()
twice might actually be faster than${childrenSelector} > .show, ${childrenSelector} > .collapsing
as it would loop on the child nodes in the tree rather than calling Sizzle/querySelector.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But frankly if there is a performance difference, one way or the other, it would be a matter nano seconds per collapsible. Unless you have an accordion with million of children the difference will be close to nothing.
I think the simplification for theBootstrap user (getting rid of data-children attribute) worth the few nano seconds that might be lost or gained.