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

Make proper use of the SelectorEngine in ScrollSpy #34207

Merged
merged 2 commits into from
Jun 23, 2021

Conversation

GeoSot
Copy link
Member

@GeoSot GeoSot commented Jun 8, 2021

  • avoid extra work, creating ids
  • simply selectors and constrain search inside config.target

@GeoSot GeoSot force-pushed the gs-scrollspy-use-selector_engine-properly branch from 6d8d493 to c9dbdad Compare June 8, 2021 07:46
@GeoSot GeoSot marked this pull request as ready for review June 8, 2021 07:51
@GeoSot GeoSot requested a review from a team as a code owner June 8, 2021 07:51
@GeoSot GeoSot changed the title Make Proper use of the SelectorEngine in SrollSpy Make proper use of the SelectorEngine in ScrollSpy Jun 8, 2021
@GeoSot GeoSot force-pushed the gs-scrollspy-use-selector_engine-properly branch from c9dbdad to 34ce061 Compare June 18, 2021 08:57

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* avoid extra work, creating ids
* simplify selectors and constrain search inside `config.target`
@GeoSot GeoSot force-pushed the gs-scrollspy-use-selector_engine-properly branch from 34ce061 to b60faa9 Compare June 22, 2021 20:18
@mdo mdo merged commit f94f497 into main Jun 23, 2021
@mdo mdo deleted the gs-scrollspy-use-selector_engine-properly branch June 23, 2021 02:50
@@ -150,15 +149,7 @@ class ScrollSpy extends BaseComponent {
...(typeof config === 'object' && config ? config : {})
}

if (typeof config.target !== 'string' && isElement(config.target)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this wasn't needed? IIRC it was used to make sure the IDs are unique or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used to make string selectors, But wasn't using the Selector engine scoped search.
I replaced the search to be done on element scope, so we keep the element as reference, not the id

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

Successfully merging this pull request may close these issues.

None yet

4 participants