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

Button after input overlaps border in input group #24216

Closed
jrysig opened this issue Oct 3, 2017 · 11 comments
Closed

Button after input overlaps border in input group #24216

jrysig opened this issue Oct 3, 2017 · 11 comments
Assignees

Comments

@jrysig
Copy link

jrysig commented Oct 3, 2017

@mdo Are you sure about this recent change?
864c657

With light button background the missing border between input and following button seems strange to me, please see https://codepen.io/anon/pen/EwwmbK

When you hover or focus input, border is displayed.

border

@mdo
Copy link
Member

mdo commented Oct 3, 2017

It looked better with the default Bootstrap button styles there 😁

@mdo
Copy link
Member

mdo commented Oct 3, 2017

I'll see what I can do. The focus state is right as it overlaps the content that comes after it—might just need to mess with the z-index more to ensure proper overlapping.

@splice7
Copy link

splice7 commented Oct 3, 2017

@mdo you are right. This worked for me:

.theinput:hover + .thebutton {
	z-index: 3;
}

.theinput:focus + .thebutton {
	z-index: 2;
}

It might not be the most elegant but it proves that z-index is the way to go.

@alecpl
Copy link
Contributor

alecpl commented Oct 22, 2017

I have a similar issue not related to buttons, but I think the change in last comment will not work. Consider two text inputs in a line, first focused. Then if you hover over the second input the focus shadow on the first will be broken. https://codepen.io/alecpl/pen/PJgRob

@ysds
Copy link
Member

ysds commented Oct 24, 2017

Hi @alecpl, Bootstrap does not support multiple form-controls in a single input group

http://getbootstrap.com/docs/4.0/components/input-group/#basic-example

@mdo I'm working on creating PR for this issue, but I need your help about z-index specifications. In normal state (not hovered/focused/actived), the following patterns are considered. Which one is the most preferable?

image

@mdo
Copy link
Member

mdo commented Oct 29, 2017

The second one is most ideal. Apologies for the delayed response—missed this while I was out this last week on vacation.

@ysds
Copy link
Member

ysds commented Nov 1, 2017

@mdo thank you for your reply.

Input groups has become also support custom selects and custom files, we should check these z-indexes. I noticed about unsure z-index value of custom files, I reported the issue #24632 and PR.

@ysds
Copy link
Member

ysds commented Dec 14, 2017

I have been considering this issue for a while and noticed further related subject. I will create a issue later.

@mdo
Copy link
Member

mdo commented Dec 16, 2017

This will likely be addressed by #25020.

@mdo mdo added the has-pr label Dec 18, 2017
@mdo
Copy link
Member

mdo commented Dec 23, 2017

#25020 merged, so closing.

@mdo mdo closed this as completed Dec 23, 2017
@iliajie
Copy link

iliajie commented Jan 24, 2020

The simple solution for existing projects would be simply adding this rule:

.form-control:focus
{
    z-index: 9999;
    position: relative;
}

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

No branches or pull requests

8 participants
@splice7 @mdo @alecpl @Johann-S @ysds @iliajie @jrysig and others