Navigation Menu

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

B-input: custom icon-right is replaced when b-field has a message #2507

Closed
fabiofdsantos opened this issue May 13, 2020 · 4 comments
Closed

Comments

@fabiofdsantos
Copy link
Contributor

fabiofdsantos commented May 13, 2020

Overview of the problem

Buefy version: 0.8.18
OS/Browser: macOS / Safari

Description

If b-field has a message of type danger, the custom icon-right of b-input is replaced.

Steps to reproduce

      <b-field
        label="Password"
        type="is-danger"
        message="Password needs more than 5 characters."
      >
        <b-input
          type="password"
          value="123"
          icon-right="close-circle"
          icon-right-clickable
        />
      </b-field>

Expected behavior

Display the message but persist the custom icon (if it has been set previously). Or persist it if it's clickable.

image

Actual behavior

The custom icon is being removed.

image

@jtommy
Copy link
Member

jtommy commented May 14, 2020

Probably it's better add a new prop in order to choose what's the priority

@fabiofdsantos
Copy link
Contributor Author

So, to recap I see at least 3 potential approaches:

  • If icon-right-clickable or icon-clickable is defined, the icon will be persisted as password-reveal.
  • Custom prop to define priority.
  • Append a new icon in case of an error and have a maximum of 2 icons.

I'm not totally against any option but I think we should avoid too much props that are somehow dependant. Even without the custom prop to define priority, we are able to determine if the custom icon should be displayed (e.g. a clear button to be displayed based on input length).

@jtommy
Copy link
Member

jtommy commented May 15, 2020

Probably the first approach is the correct way and you can hide the right icon when input is not valid setting it to undefined

@fabiofdsantos
Copy link
Contributor Author

@jtommy Yes, I agree.

@jtommy jtommy closed this as completed in 18bede9 May 16, 2020
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

2 participants