react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Creatable not support input.focus().

Open m-basarab opened this issue 9 years ago • 8 comments

Hi. I am trying to focus on Creatable using: ref={(input)=>{ if(input!=null){ input.focus(); } }}; , but I can't. https://plnkr.co/edit/LaTJN70HFRNRuFMR6vpn?p=preview

m-basarab avatar Dec 16 '16 13:12 m-basarab

@m-basarab have you tried passing in the autofocus prop?

You could adjust your example to this:

<Select.Creatable
    autofocus
    name="form-field-name"
    value="one"
    openOnFocus={true}
    options={options}
    onChange={logChange}
  />

jxodwyer avatar Dec 21 '16 05:12 jxodwyer

@jxodwyer autofocus does not allow to create the label for Creatable. That is for instance my issue.

So I want to have label alongside with Creatable, how could I achieve that?

Just standard html label which makes focus on click on it.

Thanks.

AlexanderTserkovniy avatar Feb 16 '17 09:02 AlexanderTserkovniy

@jxodwyer How is this related if Creatable doesn't expose Select's instance method focus? The same issue was with Async component, before it was fixed in RC2.

May I submit a pull request with focus method?

the-spyke avatar Feb 19 '17 13:02 the-spyke

Since the example was essentially calling focus right away I thought autofocus was sufficient. Yeah, that makes sense to me.

jxodwyer avatar Feb 19 '17 15:02 jxodwyer

This appears to be the case for AsyncCreatable as well.

mattraykowski avatar Mar 13 '17 15:03 mattraykowski

This should be fixed I think, so Issue could be closed @JedWatson Are you planning a publication on npm soon?

Grisu118 avatar Apr 03 '17 06:04 Grisu118

@JedWatson Could you close this, it is fixed.

jnachtigall avatar Jan 18 '18 09:01 jnachtigall

Thanks for the heads up @jnachtigall

JedWatson avatar Jan 18 '18 11:01 JedWatson