Skip to content

Releases: JedWatson/react-select

react-select@3.0.8

02 Oct 04:42

Choose a tag to compare

Patch Changes

  • a575a3c4 #3727 Thanks @tonytangau! - Adding an index prop to MultiValue components
  • 916f0d2c #3644 Thanks @TrySound! - Remove usage of raf package and replace with window.requestAnimationFrame because React already depends on requestAnimationFrame
  • cba15309 #3676 Thanks @wiesys! - Fix loadingMessage and noOptionsMessage properties in Styles flow type
  • 32f9475e #3790 Thanks @JedWatson! - Remove unnecessary dependency on classnames package
  • 1731175d #3733 Thanks @ddc67cd! - Pass name to onChange meta in Creatable to make it consistent with onChange in standard Select

v3.0.3

27 May 12:23

Choose a tag to compare

The core motivation behind 3.0.0 is to set us up to leverage new tools to make react-select better. As such we've made the following changes:

Breaking Changes

  • Upgrade from Emotion 9 to Emotion 10
  • UMD builds deprecated
  • Multiple Entrypoints
  • React 16.8 required as peer dependencies
  • Normalized Values #3416

What this means for you

Emotion 10

Moving to the latest major version of emotion affords us zero-config SSR and enabling easier CSP support. Unfortunately this will be a breaking change for consumers who are currently leveraging emotion to build custom components for react-select. For example, you'd previously create an custom Option component with emotion like so:

import { css } from 'emotion'

const customOption = ({ cx, className, getStyles, _ }) => 
  <div 
     classNames={cx(
       css(getStyles('option', props)), 
       {
         'option': true,
         'option--is-disabled': isDisabled,
         'option--is-focused': isFocused,
         'option--is-selected': isSelected,
        },
        className
     )}
     {...}
  >

With react-select 3.0.0, and emotion 10 it would be the following:

/** @jsx jsx */
import { jsx } from '@emotion/core';

const customOption = ({ cx, className, getStyles, _ }) => 
  <div 
    css={getStyles('option', props)}
    classNames={cx(
     {
       'option': true,
       'option--is-disabled': isDisabled,
       'option--is-focused': isFocused,
       'option--is-selected': isSelected,
      },
      className
    )} 
    {...}
  >

Multiple Entrypoints:

v3.0.0 separates removes the following components from the main entry point, and instead exports them as separate entrypoints:

  • Async (now exported from react-select/async)
  • Creatable (now exported from react-select/creatable)
  • Async Creatable (now exported from react-select/async-creatable)
  • makeAnimated and default animated components (now exported from react-select/animated)

Where you’d previously import them as such

	import { Async } from 'react-select'  

Or as:

	import Async from 'react-select/lib/Async'

Now imports look like this:

	import AsyncSelect from 'react-select/async'

This should have no bundle-size impact on react-select consumers currently leveraging tree-shaking. However for consumers who aren’t leveraging tree-shaking, this should help alleviate some of the bundle-weight.

UMD Builds

UMD builds have been removed as of react-select v3.

Peer dependency on React 16.8

We've decided on requiring 16.8 as a peer dependency for react-select 3.0.0. This is motivated by our commitment to leveraging the improvements in recent versions of React such as hooks to make react-select even better.

Normalized Values

At the moment, if no value is specified by the consumer, it's instantiated as a null value, regardless of whether the select isMulti or not.

When isMulti is false this is fine. On selection of an option, the value becomes an object, and on clearing of said value, it returns to being null. (null --> {} --> null)

However when isMulti is true, this becomes more inconsistent. On selection of options, the value becomes an array of options, removing values extricates them from this array, removing the last selected value results in an empty array, instead of the initial base state of null.
(null --> [{}] --> [])

We rectify this in 3.0.0, on removal of all selected values in an isMulti Select, the value passed to onChange is null and not [].
normalize-value

  • Remove base entrypoint to fix rollup dependency resolution issue in 3.0.3
  • See #3585 for a detailed list of changes in 3.0.0

v2.4.2 / 2019-03-11

11 Mar 23:21

Choose a tag to compare

Bug fixes

  • #3446 Fix bug with select input value not being selectable. Thanks @kangweichan
  • #3445 Fix accessibility bug. Disabled options are now focusable and announced by screen-readers but not selectable. Thanks @sarahbethfederman

Updates

v2.4.1 / 2019-02-18

11 Mar 23:21

Choose a tag to compare

Bug fixes

  • #3432 Fix bug with select menu's not working on mobile.

v2.4.0 / 2019-02-15

15 Feb 05:24

Choose a tag to compare

Bug fixes

  • #3427 remove focusOption() invocation on ENTER press if the menu is not open.
  • #3402 fix menu scroll being reset on focus of a select with an open menu in ie11. See #3342 for details. Thanks timothypage
  • #3420 fixed select menu being opened on click, when openMenuOnClick is false. Thanks caleb and rscotten
  • #3419 fixed bug with ScrollCaptor operating on an undefined scrollTarget. Thanks iulian-radu-at
  • #3411 fix bug where Enter key press on select with a closed menu wouldn't propagate up. Resolves #2217.
  • #3407 remove unnecessary aria-roles from menu and options. This is now all handled by our aria-live implementation. Resolves #3355. Thanks sarahbethfederman.
  • #3393, fix aria live announcement text for removing a selected option. Thanks msharkeyiii.
  • #3350 Updated to 0.91 of flow. Updated types to pass stricter type checking, in later versions of flow. Thanks DragonWW

Updates

  • #3370 Updated memoize-one dependency to 5.0.0. Thanks adam187
  • #3366 Update build tooling, to leverage babel 7. Thanks DragonWW

v2.3.0 / 2019-01-18

18 Jan 00:30

Choose a tag to compare

Bug fixes

  • #3315 add RAF call to Collapse component getRef() such that getBoundingClientRect() is invoked consistently.
  • #3275 wrap String invocation around inputValue to avoid calling toLowerCase on invalid elements. thanks tavareshenrique
  • #3357, fix loadOptions call in Async select to always pass in a string for the inputValue.
  • #3346 Revert work done in CSP nonce PR #3260 to unblock react-select usage in an SSR setting. Users who need nonce support still, please pin your version of react-select at 2.2.0. Nonce support will be re-added in 3.0.0 along with an upgrade to emotion 10; which includes nonce support without having to provide a custom emotion instance.

Features

  • #3115 menu-is-open modifier added to control class when the menu is open. @s20lee

v2.2.0 / 2018-12-28

28 Dec 05:25

Choose a tag to compare

Bug Fixes

  • #3296 Fix for tab interactions when in composition mode with an IME. Thanks yshr446 for the PR.
  • #3302 Fix to breaking android and mobile safari touch bug #2755, by adding more conscientious checks to the onTouchStart and onTouchMove listeners. Thanks xakep139 for the PR.
  • #3303 Input and GroupHeading components now get passed the selectProps prop, thanks maxmarchuk for the PR.
  • #3260 As a result of the CSP nonce support feature, the emotion instance is now cached and passed down to all internal components, meaning that users looking to heavily customise their Select components can do so without externally importing emotion, and nonce instances are respected per select instance. Please see this segment in the docs for a more detailed explanation.
  • #3299 fix to assistive text on menu open.

Features

  • #3260 Add CSP nonce support to Select, thanks Avaq and Andarist for the heavy lifting.

v2.1.1

24 Oct 04:00

Choose a tag to compare

Bug fixes

  • [#3132] Strip theme props from default Input and GroupHeading components, as they were polluting the DOM.
  • [#3131] Add support for the 'Delete' key in the internal onKeyDown method. Same functionality as 'Backspace'.
  • [#3100] Update flow-types and normalised default prop declarations in indicators. Thanks iseredov

Updates

  • [#3083] Added sideEffects property to package.json to support tree-shaking in webpack 4.x. Thanks SimenB.
  • [#3078] Update jest dependency to 23.6.0. Thanks papandreou
  • [#3065] Update babel-plugin-emotion to 9.2.10. Thanks mtzhang
  • [#3108] Update docs to include instructions for replicating the simple-value use case within react-select v2. Thanks elboletaire

v2.1.0

17 Oct 02:44

Choose a tag to compare

  • [#2839] Added support for theming via theme prop. Thanks akx
  • [#2874] Fixed flow-types of MultiValue components. Thanks mike1808
  • [#2903] Fix missing form input when there isn't a selected value. Thanks alvinsj
  • [#2934] Reduced theme colors to a sane value set to make the exported theme more easy to consume and configure. Thanks jossmac
  • [#2876] Added overflow hidden to valueContainer to stop overflowing text in the control. Thanks mike1808
  • [#2975] Separated menu placement logic from menu primitive. Thanks jossmac.

v2.0.0

21 Sep 06:01

Choose a tag to compare

v2.0.0 / 2018-07-23

  • async select now accepts a filterOptions function as a prop #2822
  • [BREAKING] react-select now exports react-select.esm.js from dist instead of react-select.es.js #2641
  • [BREAKING] innerRef assignments in custom components must now be made from the root of the prop object, as opposed to reaching into innerProps. This is part of the work to normalize the behaviour circa custom components. #2824
  • className and classNamePrefix deprecation warning and backward compatibility removed. className now only affects the select container, classNamePrefix prefixes all internal components. #2820
  • Added closeMenuOnScroll prop, which can either be a boolean or a function, if set to true the select menu will close on scroll of the document/body. If a function is supplied, it must take the following shape (event: ScrollEvent) => boolean, the boolean value will be used to resolve whether the menu should be closed or stay open. #2809, thanks Vynlar for this.
  • Added fix to support IME inputs. #2767, thanks shamabe
  • Removed primitives, and normalise multi-value components to be in line with existing component customisation patterns. #2821
  • Normalised isOptionDisabled to be inline with its sibling prop isOptionSelected. #2821 Thanks SimeonC
  • #2814 Added memoization to custom components within Select.js as well as in the exported makeAnimated factory method. Thanks to Alex Reardon's memoize-one
  • #2652, Async Select now re-evaluates defaultOptions on componentWillReceiveProps. Thanks jesstelford