Skip to content

Releases: JedWatson/react-select

[email protected]

19 Mar 18:19
b0411ff
Compare
Choose a tag to compare

Minor Changes

Patch Changes

  • 7a414a7c #3262 Thanks @torkelo!
    • The Menu bottom is no longer scrolled into view when menuShouldScrollIntoView=false

Documentation Updates

  • #4109 Thanks @manvydasu
    • Replaced componentWillReceiveProps with componentDidUpdate in docs

[email protected]

05 Mar 16:18
56be61b
Compare
Choose a tag to compare

Patch Changes

  • ca3c41bb #4478 Thanks @ebonow! - Check passive events polyfill for the existence of window for SSR

[email protected]

05 Mar 03:35
ef2090e
Compare
Choose a tag to compare

Minor Changes

  • 2ffed9c6 #4444 Thanks @Rall3n! - Use accessor props to get value and label in compareOption

  • 2baf5a9d #4414 Thanks @ebonow! - Add ariaLiveMessages prop for internationalization and other customizations, add aria-live prop, and other accessibility fixes. Inspired heavily from the work done by @Kashkovsky, @radegran, @Malgalad, and @TheHollidayInn - thanks to them, @bozdoz for the thorough testing and recommendations, and for everyone who contributed constructive feedback towards a better accessibility experience.

  • 7cdb8a6b #4391 Thanks @ebonow! - Pass and sanitize CommonProps passed to Group and Input components

Patch Changes

[email protected]

07 Feb 00:35
6f0b424
Compare
Choose a tag to compare

Minor Changes

  • b5f9b0c5 #4342 Thanks @Methuselah96! - Standardized innerProps and className props on customizable components

  • 19b76342 #3911 Thanks @eugenet8k! - Add removedValues to onChange event meta when the action is clear (when the user clears the value in the Select)

Patch Changes

[email protected]

22 Jan 23:31
a62f1aa
Compare
Choose a tag to compare

Patch Changes

[email protected]

22 Jan 17:57
e7bafee
Compare
Choose a tag to compare

Patch Changes

[email protected]

22 Jan 13:30
4da6ee0
Compare
Choose a tag to compare

Upgrade Guide

Summary

  • Standardize value passed to onChange (#4339) - the onChange handler is now always passed an array of options if isMulti is set to true
  • Emotion 11 (#4283) - should only affect you if you're using the NonceProvider component
  • Remove usage of UNSAFE React methods (#4313) - shouldn't affect you except now you won't see those warning messages in the console anymore

Details

Standardize value passed to onChange

This change makes it so that the first parameter passed to the onChange callback will now always be an array of options if isMulti is set to true and will always be a single option or null if isMulti is set to false. Previously the first parameter of onChange could be an array or null when isMulti was set to true.

That means if you were previously using nullish coalescing in order to handle null for isMulti:

<Select
  isMulti
  onChange={(newValues) =>  setValues(newValues ?? [])}
/>

You can now remove the nullish coalescing because onChange will always be an array when isMulti is set to true:

<Select
  isMulti
  onChange={(newValues) =>  setValues(newValues)}
/>

Emotion 11

The NonceProvider component now requires a cacheKey prop that corresponds to the newly required key prop for the Emotion cache. This won't affect you if you aren't using NonceProvider. See #4283 for more details.

Remove usage of UNSAFE React methods

This isn't necessarily a breaking change, but it required a large refactor in order to accomplish so we released this in a major upgrade in case it has some unintended consequences.

Changelog

Major Changes

Patch Changes

[email protected]

13 Jan 13:43
45f6f29
Compare
Choose a tag to compare

Minor Changes

  • c615e93d #4084 Thanks @JedWatson! - Changed the cx and getValue props that are passed to components into instance properties, which means they now pass a referential equality check on subsequent renders.

    This is helpful, for example, when you're optimising the performance of rendering custom Option components - see #3055

  • 72f6036f #4306 Thanks @bladey! - Remove duplicate prop createOptionPosition

Patch Changes

[email protected]

23 Nov 07:53
17b406a
Compare
Choose a tag to compare

Patch Changes

[email protected]

22 Mar 04:02
Compare
Choose a tag to compare

Minor Changes

Patch Changes