smuggledPancakes
smuggledPancakes

Reputation: 10323

Disable a Search element in Semantic-ui-react

I thought adding disabled to the className would do the trick. It works for a button. I am stumped.

      <Search
        className="findSearchBar disabled"
        ...
        ...
        ...
      />

Upvotes: 0

Views: 1221

Answers (2)

smuggledPancakes
smuggledPancakes

Reputation: 10323

I found out that in order to get the property to the child, which in this case is the input element, I just need to pass it in as a prop. I happen to have a boolean value called disabled, and I just use it like this.

     <Search
        className="findSearchBar"
        disabled={disabled}
        ...
        ...
        ...
      />

Upvotes: 0

arrra
arrra

Reputation: 31

Here is an example from there docs:

<div class="ui search">
  <div class="ui disabled input">
    <input class="prompt" type="text" placeholder="Common passwords...">
    <i class="search icon"></i>
  </div>
  <div class="results"></div>
</div>

Upvotes: 1

Related Questions