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

Allow borderless SearchBox.ExpandButton #2238

Merged
merged 20 commits into from
Sep 19, 2024
Merged

Conversation

r100-stack
Copy link
Member

@r100-stack r100-stack commented Sep 11, 2024

Changes

Goal of this PR is to allow a borderless SearchBox.ExpandButton during the collapsed state. This should be supported since SearchBox.ExpandButton is essentially an IconButton. However, it doesn't happen so far even with adding styleType="borderless" to SearchBox.ExpandButton since the border that on the container is never removed.

I first thought to add a new styleType prop to CollapsedState. When this prop is borderless, it sets a data attribute in iui-expandable-searchbox. Presence of this attribute will remove its border and the background. However, to decrease the complexity of the API, @mayank99 suggested to try to avoid adding a new prop.

The current approach I'm using is to directly hide the border and background on iui-expandable-searchbox when it's collapsed. No visual change should be perceived as the same background and border now come from the ExpandButton instead.

Collapsed state (before and after are the same)

screenshot

Users using the SearchBox in ways that we haven't demoed in our examples may notice some change after this PR. However, after discussing with @mayank99, we concluded that those custom cases are uncommon and also unlikely to be useful for users.

Testing

Added a story and thus a visual test. Since this PR mainly adds a visual change using css styles, I felt no unit or e2e tests were necessary.

Docs

  • Added one minor changeset each for @itwin/itwinui-css and @itwin/itwinui-react.
  • Added docs and an accompanying demo.

@r100-stack r100-stack self-assigned this Sep 11, 2024
@r100-stack r100-stack marked this pull request as ready for review September 16, 2024 21:17
@r100-stack r100-stack requested a review from a team as a code owner September 16, 2024 21:17
@r100-stack r100-stack requested review from mayank99 and smmr-dn and removed request for a team September 16, 2024 21:17
Copy link
Contributor

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

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

LGTM

@r100-stack r100-stack enabled auto-merge (squash) September 19, 2024 14:19
@r100-stack r100-stack merged commit cb346ec into main Sep 19, 2024
16 of 17 checks passed
@r100-stack r100-stack deleted the r/searchbox-borderless branch September 19, 2024 14:25
@imodeljs-admin imodeljs-admin mentioned this pull request Sep 19, 2024
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