-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: master
Are you sure you want to change the base?
Conversation
f989d8c
to
04cb569
Compare
04cb569
to
76a5eaa
Compare
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; }`); |
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 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} = {}) { |
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.
I considered naming the flag updateUrl
, but slightly prefer false by default param, so went with dontUpdateUrl
Needed for https://github.com/mixpanel/analytics/pull/41714