-
Notifications
You must be signed in to change notification settings - Fork 927
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
Split text input padding into 2 separate properties #7338
Conversation
d4b8430
to
d0915e1
Compare
@@ -135,7 +135,10 @@ namespace gdjs { | |||
this._readOnly = objectData.content.readOnly; | |||
this._textAlign = parseTextAlign(objectData.content.textAlign); //textAlign is defaulted to 'left' by the parser if undefined. | |||
this._maxLength = objectData.content.maxLength || 0; //maxlength and padding require a default value as they can be undefined in older projects. | |||
this._padding = objectData.content.padding || 0; | |||
this._padding = | |||
objectData.content.padding !== undefined |
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.
Is this for clarity of code, or does behavior changes too ?
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.
Now that the default value is 1, if I had kept the check like this: objectData.content.padding || 1
If the user entered the value 0, objectData.content.padding
would be falsy, so the padding would get the value 1. That's where the undefined
check comes in useful
Result:
Also: