Skip to content

refactor: reset css property value when ''" (empty string) is set #5085

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

Merged
merged 6 commits into from
Nov 27, 2017

Conversation

sis0k0
Copy link
Contributor

@sis0k0 sis0k0 commented Nov 21, 2017

No description provided.

@ghost ghost assigned sis0k0 Nov 21, 2017
@ghost ghost added the in progress label Nov 21, 2017
@@ -1049,6 +1050,9 @@ export class ShorthandProperty<T extends Style, P> implements definitions.Shorth
}
}

const shouldResetCssProperty = value =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Inline this.

@sis0k0 sis0k0 force-pushed the vlaeva/unset-css-property branch from c1bf8cd to a30600b Compare November 22, 2017 09:14
@@ -534,7 +535,8 @@ export class CssProperty<T extends Style, U> implements definitions.CssProperty<
}

function setCssValue(this: T, value: U): void {
const reset = value === unsetValue;
const reset = value === unsetValue ||
typeof value === "string" && value === "";
Copy link
Contributor

Choose a reason for hiding this comment

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

value === "" should suffice

Copy link
Contributor Author

@sis0k0 sis0k0 Nov 22, 2017

Choose a reason for hiding this comment

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

value is of type U. I can't be even explicitly casted to <string>. Should I cast it to <any>?

@sis0k0 sis0k0 merged commit db41bec into master Nov 27, 2017
@sis0k0 sis0k0 deleted the vlaeva/unset-css-property branch November 27, 2017 14:12
@lock
Copy link

lock bot commented Aug 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants