React-select: Document action types

Created on 13 Sep 2018  路  2Comments  路  Source: JedWatson/react-select

Here's what I gather from console.log's:

  • select-option - Add new chip
  • deselect-option - Can't figure out how to trigger this
  • remove-value - Remove chip
  • pop-value - Can't figure out how to trigger this
  • set-value - Can't figure out how to trigger this
  • clear - Remove all chips
  • create-option - Can't figure out how to trigger this

Most helpful comment

For those coming here from Google, the documentation has been updated: https://react-select.com/advanced#action-meta

## Action Meta
React Select exposes a variety of eventListeners to you via props.
The onchange function prop now has the following signature.
(value: ValueType, action: ActionType) => undefined;

  The action argument is a string with the following possible values

  * 'select-option': Selecting an option from the list
  * 'deselect-option': (Multiple) Deselecting an option from the list
  * 'remove-value': (Multiple) Removing a selected option with the remove button
  * 'pop-value': Removing options using backspace
  * 'set-value': Calling setValue from a component without an action
  * 'clear': Removing all selected options with the clear button
  * 'create-option': (Creatable) Creating a new option

All 2 comments

For those coming here from Google, the documentation has been updated: https://react-select.com/advanced#action-meta

## Action Meta
React Select exposes a variety of eventListeners to you via props.
The onchange function prop now has the following signature.
(value: ValueType, action: ActionType) => undefined;

  The action argument is a string with the following possible values

  * 'select-option': Selecting an option from the list
  * 'deselect-option': (Multiple) Deselecting an option from the list
  * 'remove-value': (Multiple) Removing a selected option with the remove button
  * 'pop-value': Removing options using backspace
  * 'set-value': Calling setValue from a component without an action
  * 'clear': Removing all selected options with the clear button
  * 'create-option': (Creatable) Creating a new option

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.

If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.

However, if you feel this issue is still relevant and you'd like us to review it - please leave a comment and we'll do our best to get back to you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Meesam picture Meesam  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments

pgoldweic picture pgoldweic  路  3Comments

steida picture steida  路  3Comments

yrabinov picture yrabinov  路  3Comments