furqanZafar / react-selectize

http://furqanzafar.github.io/react-selectize/
Apache License 2.0
704 stars 138 forks source link

resizable-input index #127

Closed lozinsky closed 7 years ago

lozinsky commented 7 years ago

Hi.

If you add an item to values from MultiSelect's dropdown, MultiSelect's "resizable-input" is the latest in "react-selectize-search-field-and-selected-values" node. It's ok.

But if you add an item outside dropdown, then "resizable-input" ceases to be the last.

Please see: http://codepen.io/lozinsky/pen/aBXyjw

I need this to work without hack. Is it possible to fix? Thx.

furqanZafar commented 7 years ago

You can fix it by using the anchor prop:

        <reactSelectize.MultiSelect 
          placeholder="Select a color"
          onValuesChange={this.handleValuesChange}
          anchor={values[values.length - 1]} // <--- add this line to your pen
          values={values}