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

Split text input padding into 2 separate properties #7338

Merged
merged 7 commits into from
Jan 23, 2025

Conversation

AlexandreSi
Copy link
Collaborator

@AlexandreSi AlexandreSi commented Jan 23, 2025

Result:
image
Also:

  • Reinstate properties that were lost during the introduction of the value submission
  • Limit vertical padding to give priority to instance height + border width

@AlexandreSi AlexandreSi requested a review from 4ian as a code owner January 23, 2025 11:01
@@ -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
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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

@AlexandreSi AlexandreSi changed the title Fix: Hide any outline added by the browser on the text input Split text input padding into 2 separate properties Jan 23, 2025
@AlexandreSi AlexandreSi merged commit c4e230d into master Jan 23, 2025
5 of 6 checks passed
@AlexandreSi AlexandreSi deleted the fix-input-outline branch January 23, 2025 15:12
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.

4 participants