-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feature] Hash cloak option on AnchorScrollTo
(WIP)
#186
base: develop
Are you sure you want to change the base?
Conversation
Export Size@studiometa/ui
Unchanged@studiometa/ui
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #186 +/- ##
===========================================
- Coverage 28.33% 28.19% -0.14%
===========================================
Files 49 49
Lines 1246 1252 +6
Branches 239 231 -8
===========================================
Hits 353 353
+ Misses 893 830 -63
- Partials 0 69 +69
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. |
return; | ||
} | ||
|
||
window.location.hash = this.targetSelector; |
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 we avoid the problem with a specified offset ?
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.
historyReplace({ hash: 'hello-world' });
127357f
to
f99e5e1
Compare
return; | ||
} | ||
|
||
window.location.hash = this.targetSelector; |
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.
historyReplace({ hash: 'hello-world' });
@@ -27,10 +30,21 @@ export class AnchorScrollTo<T extends BaseProps = BaseProps> extends Base<Anchor | |||
* @param {MouseEvent} event | |||
* @returns {void} | |||
*/ | |||
onClick(event) { | |||
async onClick(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.
async onClick(event) { | |
async onClick(event) { | |
if ( | |
this.$el.pathname !== window.location.pathname || | |
this.$el.origin !== window.location.origin | |
) { | |
return; | |
} |
β Type of change
π Description
Add the update of the hash in the url after animation complete and add an option to disable it.
π Checklist
Feature todos
PR todos