Skip to content

Fix the search button overflow in the search block#66908

Open
sarthaknagoshe2002 wants to merge 3 commits intoWordPress:trunkfrom
sarthaknagoshe2002:fix/search-css
Open

Fix the search button overflow in the search block#66908
sarthaknagoshe2002 wants to merge 3 commits intoWordPress:trunkfrom
sarthaknagoshe2002:fix/search-css

Conversation

@sarthaknagoshe2002
Copy link
Contributor

@sarthaknagoshe2002 sarthaknagoshe2002 commented Nov 11, 2024

What?

This PR addresses the issue of the search button overflow when using button inside at width=25%.

Closes: #66906

Why?

This PR is necessary to ensure the UI doesn't break when selecting different editor options.

How?

This PR resolves the issue by matching the appearance of the block on frontend with that of the appearance in the editor

Testing Instructions

  1. Add/Create a post.
  2. Insert a Search Block.
  3. Set "Button Position" to "button inside".
  4. Set the block width to 25%.
  5. Verify that the search button's appearance is same as that of the editor on the frontend and the button is contained in the search box.

Testing Instructions for Keyboard

Verify button appearance: Use Tab and Shift confirming that the search button looks consistent and is contained within the search box in both the editor and on the frontend.

Screenshots or screencast

Frontend before Frontend after Editor
Screenshot 2024-11-11 at 6 17 16 PM Screenshot 2024-11-11 at 6 17 38 PM Screenshot 2024-11-11 at 6 51 38 PM

@github-actions
Copy link

github-actions bot commented Nov 11, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 11, 2024
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sarthaknagoshe2002! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@sarthaknagoshe2002 sarthaknagoshe2002 changed the title Fix/search css Fix the search button overflow in the search block Nov 11, 2024
@carolinan
Copy link
Contributor

These issues are tricky because the resulting width is much wider than before, it is no longer going to be "25%" and the width option is no longer going to be respected, or am I wrong?

@carolinan
Copy link
Contributor

Aside, but I think it might look better if the placeholder text was truncated with an ellipsis rather than cut off.

@sarthaknagoshe2002
Copy link
Contributor Author

sarthaknagoshe2002 commented Nov 12, 2024

@carolinan I have basically tried to match the UI on the frontend with the editor to serve 2 issues,

  1. To solve the overflow problem
  2. The UX is improved since the UI is same in the editor as well as on the frontend.

Also the overall size of the div containing the input box and button is same as earlier.
Just the input box is modified to contain the button inside the input box.

@skorasaurus skorasaurus added the [Block] Search Affects the Search Block - used to display a search field label Nov 12, 2024
@carolinan carolinan added the [Type] Bug An existing feature does not function as intended label Nov 28, 2024
@carolinan
Copy link
Contributor

I have tested this again and the added padding breaks the button styling.
In Twenty Seventeen for example, the padding is not present in the editor at all, but on the front, the padding is so large that the text "search" is split into two lines on all search blocks, even when the option "button inside" is not enabled.

@sarthaknagoshe2002
Copy link
Contributor Author

@carolinan any other approach that you would like to suggest??

@sarthaknagoshe2002
Copy link
Contributor Author

@carolinan I have updated the styling as per your suggestion to prevent the breaking of padding across different themes, please have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Search Affects the Search Block - used to display a search field First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search button overflow when using "button inside" at "width=25%"

3 participants