-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix~issues 1110 #1111
fix~issues 1110 #1111
Conversation
fix bug docsifyjs#1110
fix bug docsifyjs#1098
src/plugins/search/component.js
Outdated
// Docsify.dom.on( | ||
// $search, | ||
// 'click', | ||
// e => e.target.tagName !== 'A' && e.stopPropagation() | ||
// ); |
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.
Why this :?
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.
fix this bug
#1098
in most cases, the element that triggers the click event is not tag A .
At this time, stopPropagation event causing click the search results on the left, the right page cannot be located.
In your source code, the location is triggered by listening to the click event
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.
Oh I see. I wonder why that was there though. Why did it want to prevent clicks on non-anchor tags? EDIT: nevermind, I see @sy-records's comment.
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.
Could you give more details about ur changes?
Removing the unnecessary code and showing some test results is better.
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.
It's okay now, I tested without problems.
src/plugins/search/component.js
Outdated
Docsify.dom.on( | ||
$search, | ||
'click', | ||
e => e.target.tagName !== 'A' && e.stopPropagation() | ||
); |
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.
can you comment this instead of delete. also add why this is being commented.
use block comments (/** ... */
)
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.
He said here #1111 (comment)
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.
yeah, this is just for future reference. we can add a link to this PR instead of details.
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.
Well, I tested the mobile end and he'll affect the sidebar.
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.
can you share the details in a separate review so that he can take a look
src/plugins/search/component.js
Outdated
@@ -171,11 +171,6 @@ function bindEvents() { | |||
|
|||
let timeId; | |||
// Prevent to Fold sidebar | |||
Docsify.dom.on( |
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.
After deletion, the sidebar will be collapsed when using search on the mobile end, making search unavailable.
@docsifyjs/reviewers We can remove the modified component.js and use this PR to fix #1110. |
cc @CHU295 can you change the PR to |
@anikethsaha I modified it for him. |
Summary
fix #1110
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
lib
directory.