Need help with search button

Open to all! Ask other shopowners for help.
Post Reply
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Need help with search button

Post by lecarlb »

Hello,

I need some help with the search button alignment on small viewports. The site is version 1.0.8.4. It's modified. I've tried some CSS but not sure if I've tried everything. Here's what it looks like:
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Need help with search button

Post by burt »

Looks like your search input is extending 100% pushing the button down.

Try an input group; https://getbootstrap.com/docs/4.6/compo ... ton-addons

Core example; https://github.com/CE-PhoenixCart/Phoen ... search.php
I am not here to build for you.
I am here to build with you. Let's help each other.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Need help with search button

Post by lecarlb »

burt wrote: Mon Oct 16, 2023 9:43 am Looks like your search input is extending 100% pushing the button down.

Try an input group; https://getbootstrap.com/docs/4.6/compo ... ton-addons

Core example; https://github.com/CE-PhoenixCart/Phoen ... search.php
I tried the core example, no success. I'll post what I have in user.css that affects the input group

Code: Select all

.input-group-append{
    display: flex;
}

.input-group-append .btn-info {
    position: relative;
    z-index: 2;
    background: #8a2be2;
    border: 1px solid #8a2be2;
  }

.input-group-append .btn-primary {
    position: relative;
    z-index: 2;
    background: #8a2be2;
    border: 1px solid #8a2be2;
  }

.input-group-append .btn-outline-secondary {
    background: #ffffff;
    border: 1px solid #ffffff;
  }

div.input-group input.form-control {
  width: 400px;
}
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Need help with search button

Post by 14Steve14 »

I have a vague recollection that some time ago on the old forum I was advised to add a negative margin or negative padding to the search button or the search box. The button then overlaid the search box.

I may be totally wrong as it was a while ago now.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Need help with search button

Post by burt »

I'd just remove all that css and then see if it looks correct. Add one piece of the css back in and test again until it breaks. Then you know the problem.

Most likely the last one where you set width wider than the viewport.
I am not here to build for you.
I am here to build with you. Let's help each other.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Need help with search button

Post by lecarlb »

burt wrote: Tue Oct 17, 2023 5:01 pm I'd just remove all that css and then see if it looks correct. Add one piece of the css back in and test again until it breaks. Then you know the problem.

Most likely the last one where you set width wider than the viewport.
I thought about doing that but didn't act on it. I'll give it a try and report back.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Need help with search button

Post by lecarlb »

You were right @burt. After removing all the .css and reinserting them, I changed the width of div.input-group input.form-control from 400px to 200px and it worked.

Thank you.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Need help with search button

Post by burt »

I think you could possibly remove that width setting completely and it would then auto adjust to full width. Try it?
I am not here to build for you.
I am here to build with you. Let's help each other.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Need help with search button

Post by lecarlb »

burt wrote: Wed Oct 18, 2023 2:49 pm I think you could possibly remove that width setting completely and it would then auto adjust to full width. Try it?
Ok. I'll give it a try. I'm not sure why I put it there at first.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply