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

InputSearch doesn't disable buttons when prop disabled is set #1254

Closed
estacioneto opened this issue Jun 18, 2020 · 2 comments · Fixed by #1276
Closed

InputSearch doesn't disable buttons when prop disabled is set #1254

estacioneto opened this issue Jun 18, 2020 · 2 comments · Fixed by #1276
Labels

Comments

@estacioneto
Copy link
Contributor

Describe the bug

That's the issue.

To Reproduce

Use this code in the InputSearch example and then click the clear icon button.

initialState = { value1: 'something', value2: '', value3: '' }
;<div>
  <InputSearch
    placeholder="Search..."
    value={state.value1}
    label="Small"
    size="small"
    onChange={e => setState({ value1: e.target.value })}
    onSubmit={e => {
      e.preventDefault()
      console.log('submited! search this: ', e.target.value)
    }}
    disabled
  />
  <br />
  <InputSearch
    placeholder="Search..."
    value={state.value2}
    label="Regular"
    size="regular"
    onChange={e => setState({ value2: e.target.value })}
    onSubmit={e => {
      e.preventDefault()
      console.log('submited! search this: ', e.target.value)
    }}
  />
  <br />
  <InputSearch
    placeholder="Search..."
    value={state.value3}
    label="Large"
    size="large"
    onChange={e => setState({ value3: e.target.value })}
    onSubmit={e => {
      e.preventDefault()
      console.log('submited! search this: ', e.target.value)
    }}
  />
</div>

Expected behavior

Should not clear the input value

@estacioneto estacioneto added 🐛 Bug 💻 Dev needed This issue needs a friendly developer to implement it. labels Jun 18, 2020
@vlaux
Copy link
Member

vlaux commented Jul 10, 2020

Should this clearable button be even visible when input is disabled?
Our Select, when disabled, hides this icon:
image

@davicostalf
Copy link
Contributor

I agree with @vlaux, there shouldn't be a clear icon in the disabled variant.

@vlaux vlaux linked a pull request Jul 10, 2020 that will close this issue
4 tasks
@vlaux vlaux removed the 💻 Dev needed This issue needs a friendly developer to implement it. label Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants