Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84cb7f1 commit d0d4383Copy full SHA for d0d4383
src/core/event/index.js
@@ -99,11 +99,16 @@ export function Events(Base) {
99
if (headingsInView.size === 1) {
100
activeHeading = headingsInView.values().next().value;
101
} else if (headingsInView.size > 1) {
102
- activeHeading = Array.from(headingsInView).reduce((closest, current) => {
103
- return !closest || (closest.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_FOLLOWING)
104
- ? current
105
- : closest;
106
- }, null);
+ activeHeading = Array.from(headingsInView).reduce(
+ (closest, current) => {
+ return !closest ||
+ closest.compareDocumentPosition(current) &
+ Node.DOCUMENT_POSITION_FOLLOWING
107
+ ? current
108
+ : closest;
109
+ },
110
+ null,
111
+ );
112
}
113
114
if (activeHeading) {
0 commit comments