Skip to content

Make proper use of the SelectorEngine in ScrollSpy#34207

Merged
mdo merged 2 commits into
mainfrom
gs-scrollspy-use-selector_engine-properly
Jun 23, 2021
Merged

Make proper use of the SelectorEngine in ScrollSpy#34207
mdo merged 2 commits into
mainfrom
gs-scrollspy-use-selector_engine-properly

Conversation

@GeoSot
Copy link
Copy Markdown
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
* 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
Comment thread js/src/scrollspy.js
...(typeof config === 'object' && config ? config : {})
}

if (typeof config.target !== 'string' && isElement(config.target)) {
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants