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

AAE-25888 Offset SearchTextInput expansion based on search icon width #10213

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

wojd0
Copy link
Contributor

@wojd0 wojd0 commented Sep 13, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)

https://hyland.atlassian.net/browse/AAE-25888

Expandable search text input offset by approximate not full value to compensate for the search icon's width.

What is the new behaviour?

Expandable search text input offset by 100% minus actual search icon width.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@@ -197,15 +197,19 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
return this.autocomplete ? 'on' : 'off';
}

get searchIconOffset(): string {
return this.expandable ? '48px' : '0px';
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you presume the icon is 48px all the time? is this hardcoded somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's the combined padding and width coming from angular material's .mat-mdc-form-field-icon-suffix class
Screenshot 2024-09-16 at 09 46 16

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this mean that, if something changes in the styles we will have a problem here? isn't there a more flexible approach to this issue?

@VitoAlbano VitoAlbano force-pushed the fix/AAE-25888-search-text-input-transform-offset branch from ea7174b to 0bfc43a Compare September 16, 2024 10:09
@@ -197,15 +197,19 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
return this.autocomplete ? 'on' : 'off';
}

get searchIconOffset(): string {
return this.expandable ? '48px' : '0px';
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this mean that, if something changes in the styles we will have a problem here? isn't there a more flexible approach to this issue?

@wojd0 wojd0 force-pushed the fix/AAE-25888-search-text-input-transform-offset branch 2 times, most recently from 607331b to 55468ec Compare September 17, 2024 07:07
Comment on lines +18 to +21
&-search-button-inactive {
margin-left: -48px;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this approach using a separate class for the inactive search button state should be more customization-friendly

@VitoAlbano VitoAlbano force-pushed the fix/AAE-25888-search-text-input-transform-offset branch from 55468ec to cd96e26 Compare September 19, 2024 14:34
Copy link

sonarcloud bot commented Sep 19, 2024

@wojd0 wojd0 merged commit 4998bdd into develop Sep 19, 2024
17 checks passed
@wojd0 wojd0 deleted the fix/AAE-25888-search-text-input-transform-offset branch September 19, 2024 15:31
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.

3 participants