Skip to content

fix: text overlay in replace input#162036

Merged
andreamah merged 4 commits intomicrosoft:mainfrom
g1eny0ung:fix/text-overlay-in-replace-input
Nov 24, 2022
Merged

fix: text overlay in replace input#162036
andreamah merged 4 commits intomicrosoft:mainfrom
g1eny0ung:fix/text-overlay-in-replace-input

Conversation

@g1eny0ung
Copy link
Copy Markdown
Contributor

@g1eny0ung g1eny0ung commented Sep 27, 2022

Signed-off-by: Yue Yang g1enyy0ung@gmail.com

This PR tries to fix the below text overlay problem in the replace input:

image

After:

image

I will add the explanation in the comments.

Fixes #151624

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree


public set width(newWidth: number) {
this.inputBox.paddingRight = this.cachedOptionsWidth;
this.inputBox.width = newWidth;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here I remove this line because set paddingRight(paddingRight: number) already calculates the input width with the right padding. Setting the width again is redundant.

display: inline-block;
vertical-align: middle;
width: 100% !important;
width: 100%;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change and the below changes aim to reduce unnecessary width settings. The inline width will be overridden by width: 100% !important;, so these operations are also redundant.

@g1eny0ung g1eny0ung marked this pull request as ready for review September 27, 2022 18:41
@bpasero bpasero assigned roblourens and unassigned bpasero Sep 28, 2022
@roblourens
Copy link
Copy Markdown
Member

Is there an open issue for this? I think I remember one but can't find it. If not, please open one.

@andreamah
Copy link
Copy Markdown
Contributor

andreamah commented Sep 28, 2022

Is there an open issue for this? I think I remember one but can't find it. If not, please open one.

Linked the relevant issue

@g1eny0ung
Copy link
Copy Markdown
Contributor Author

@roblourens @andreamah Will this PR be included in the October release?

@andreamah
Copy link
Copy Markdown
Contributor

@roblourens @andreamah Will this PR be included in the October release?

Unfortunately, we weren't able to get to reviewing this one in time for October, apologies for that! :(

@andreamah andreamah modified the milestones: October 2022, November 2022 Oct 24, 2022
@g1eny0ung
Copy link
Copy Markdown
Contributor Author

@roblourens @andreamah Will this PR be included in the October release?

Unfortunately, we weren't able to get to reviewing this one in time for October, apologies for that! :(

Never mind. Hopefully this fix will be reviewed and merged in November. :)


setWidth(newWidth: number): void {
this.width = newWidth;
this.domNode.style.width = this.width + 'px';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a bit unsure on why this is redundant? Wouldn't we want to keep re-setting the findInput's width for include/exclude?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

image

@andreamah Perhaps these screenshots can help to understand why this line and below are redundant. If the .monaco-findInput has the width: 100% property (changes above 👆), setting the dom width manually will override it.

These two parts contradict each other, the past code used the !important rule, then manually setting the widths is a redundant operation, as they will be overridden. The opposite is also true, so here we just need to remove the !important and remove the manual setting of the dom width to allow the input width to scale automatically.

Copy link
Copy Markdown
Contributor

@andreamah andreamah left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution!

@andreamah andreamah merged commit 34af9dd into microsoft:main Nov 24, 2022
@g1eny0ung g1eny0ung deleted the fix/text-overlay-in-replace-input branch November 25, 2022 07:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

text in Find in Files Replace textbox does not wrap correctly around Preserve Case button

6 participants