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

clearButton and isValid Indicators Occupies Same Space #658

Closed
SonicMagna opened this issue Jul 27, 2021 · 3 comments
Closed

clearButton and isValid Indicators Occupies Same Space #658

SonicMagna opened this issue Jul 27, 2021 · 3 comments
Labels

Comments

@SonicMagna
Copy link

Version:

react-bootstrap-typeahead: 5.2.0

Steps to reproduce:

A default installation using basic features and clearButton in conjunction with isValid/isInvalid (from here on I will only refer to isValid).
Use clearButton in conjunction with isValid.
Select an item from the list that will trigger both Clear and Valid.

  <Typeahead
      id="basic-example"
      onChange={setSelected}
      options={options}
      placeholder="Choose a state..."
      selected={selected}
      isValid={true}
      clearButton
    />

Expected Behavior

Visual separation of the clearButton and isValid indicators.

Actual Behavior

The indicators will be visually on top of each other; in the same space at the right end of the input field.
I was able to replicate this in https://codesandbox.io/s/9jq9jyzmry simply by adding:

      isValid={true}
      clearButton

and selecting something from the list.
In my project I am attempting to change CSS stuff around to get it looking correct, but figured I would let you know of the out-of-box behavior.
Thanks for the effort! :)

@SonicMagna SonicMagna added the bug label Jul 27, 2021
@ericgio
Copy link
Owner

ericgio commented Jul 28, 2021

Hi @SonicMagna, thanks for filing this issue! I can indeed reproduce the problem. I'll need to think about an appropriate solution.

@chneau
Copy link

chneau commented Aug 5, 2021

HI @SonicMagna , I'm using this as a workaround:

.rbt.has-aux .form-control.is-valid,
.rbt.has-aux .form-control.is-invalid {
  background-position: right 1.6rem center;
}

Which makes it look like this
image
and css is the same for normal controls without the "x"

@ericgio
Copy link
Owner

ericgio commented Oct 30, 2021

Fixed in v6.0.0-alpha.4

@ericgio ericgio closed this as completed Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants