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

chore: search input padding right to much #3757

Closed
wants to merge 1 commit into from
Closed

chore: search input padding right to much #3757

wants to merge 1 commit into from

Conversation

datlechin
Copy link
Contributor

image

Fixes #0000

Changes proposed in this pull request:

Reviewers should focus on:

Screenshot

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)
  • Related core extension PRs: (Remove if irrelevant)

@datlechin datlechin requested a review from a team as a code owner March 12, 2023 15:41
@davwheat
Copy link
Member

I believe this was done to house the "clear" button. Could we move that button into the padding area instead of removing the padding?

@datlechin
Copy link
Contributor Author

datlechin commented Mar 12, 2023

@davwheat the 'clear' button created by browser. see the search input in the front
image

@davwheat
Copy link
Member

davwheat commented Mar 12, 2023

With the frontend forum search, a .Search-clear button appears created by Flarum itself

image

This is the reason we have the right padding. In reality, we should remove the .Search-input class from the users list search instead, since it doesn't use the Search component, but this will remove the search icon and such from it.

<div className="Search-input">
<input
className="FormControl SearchBar"
type="search"
placeholder={app.translator.trans('core.admin.users.search_placeholder')}
oninput={(e: InputEvent) => {
this.isLoadingPage = true;
this.query = (e?.target as HTMLInputElement)?.value;
this.throttledSearch();
}}
/>
</div>,


@SychO9 since this issue isn't a major one, what do you think about using a new CSS feature to fix this? (Only lacks support in Firefox right now.)

This will set padding-right to 8px when there's no .Search-clear button, so will preserve the correct padding on the forum, while allowing us to show the search icon on other fields.

.Search-input:not(:has(.Search-clear)) input {
    padding-right: 8px;
}

image

image

@datlechin datlechin closed this by deleting the head repository Apr 11, 2023
@github-actions github-actions bot mentioned this pull request May 17, 2023
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.

2 participants