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

Add dontUpdateUrl option to Router.navigate #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mduan
Copy link

@mduan mduan commented Jun 17, 2022

@mduan mduan force-pushed the md-router-dont-update-url branch 2 times, most recently from f989d8c to 04cb569 Compare June 17, 2022 01:17
@mduan mduan force-pushed the md-router-dont-update-url branch from 04cb569 to 76a5eaa Compare June 17, 2022 02:33
Comment on lines +324 to +332
el.setAttribute(`style-override`, `:host { background-color: red; }`);
await nextAnimationFrame();
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background-color: red; }`);
});

it(`it applies the styles even if the component isn't attached to the DOM`, function () {
el = document.createElement(`shadow-dom-app`);
el.setAttribute(`style-override`, `:host { background: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background: red; }`);
el.setAttribute(`style-override`, `:host { background-color: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background-color: red; }`);
Copy link
Author

Choose a reason for hiding this comment

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

Fix test failure in Firefox: expected ':host { color: blue; }:host { background: red none repeat scroll 0% 0%; }' to equal ':host { color: blue; }:host { background: red; }'

Unrelated to my changes (happens on master).

@@ -68,13 +68,15 @@ export default class Router {
this.window.history[this.historyMethod] = this.origChangeStateMethod;
}

navigate(fragment, stateUpdate = {}) {
navigate(fragment, stateUpdate = {}, {dontUpdateUrl = false} = {}) {
Copy link
Author

Choose a reason for hiding this comment

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

I considered naming the flag updateUrl, but slightly prefer false by default param, so went with dontUpdateUrl

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

Successfully merging this pull request may close these issues.

3 participants