fix(deps): update dependency react-select to v5 - abandoned #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.0.0->^5.0.0Release Notes
JedWatson/react-select
v5.7.0Compare Source
Minor Changes
0773095f#5457 Thanks @nderkim! - Add classNames API and unstyled propv5.6.1Compare Source
Patch Changes
cda16826#5482 Thanks @nderkim! - Fix unstable theme rerendering menuv5.6.0Compare Source
Minor Changes
c37e86d8#4882 Thanks @Rall3n! - Addrequiredpropv5.5.9Compare Source
Patch Changes
851ed2b8#5430 Thanks @Rall3n! - Fix focused option ifdefaultMenuIsOpenis setv5.5.8Compare Source
Patch Changes
1ad6de4e#5084 Thanks @kosciolek! - When focusing a dropdown option, the numbers included in the aria live region take filtering into consideration.v5.5.7Compare Source
Patch Changes
0ca2d5ba#5431 Thanks @nderkim! - Changeclasscomponents tofunctionalcomponentsv5.5.6Compare Source
Patch Changes
92398939#5409 Thanks @lukebennett88! - Move files around to as to be compatible with version 2 of@preconstruct/cliv5.5.5Compare Source
Patch Changes
0dd38029#5246 Thanks @Rall3n! - Fix re-focus of component in Firefox if being disabled while focusedv5.5.4Compare Source
Patch Changes
ebb0a17a#5404 Thanks @Methuselah96! - Use ResizeObserver to auto-update menu position if availablev5.5.3Compare Source
Patch Changes
07656aaa#5399 Thanks @dependabot! - Update memoize-onev5.5.2Compare Source
Patch Changes
00238f1a#5376 Thanks @lukebennett88! - Fix bug with animated multi-value select width being too widev5.5.1Compare Source
Patch Changes
0f6ef093#5381 Thanks @Methuselah96! - Disable use of ResizeObserver for menu position auto-updating to avoid potential breaking changes.v5.5.0Compare Source
Minor Changes
598f9ee0#5256 Thanks @Methuselah96! - Auto-update menu position when using menu portallingv5.4.0Compare Source
Minor Changes
5d49f70a#5249 Thanks @Methuselah96! - ExportformatOptionLabeltypes (i.e.,FormatOptionLabelMetaandFormatOptionLabelContext).v5.3.2Compare Source
Patch Changes
1f140e42#5177 Thanks @Methuselah96! - Fix view height used for menu positioning to be the scroll parent instead of the windowv5.3.1Compare Source
Patch Changes
03bf7351#5164 Thanks @Methuselah96! - Bump @emotion/react to ^11.8.1 to avoiduseInsertionEffectbugv5.3.0Compare Source
Minor Changes
c7d8d4b3#5133 Thanks @nil4! - UpdatepeerDependenciesto include React 18Patch Changes
0aaa9575#5134 Thanks @rkulinski! - Use defaultPrevented to skip duplicate event handler for clicking select.87e14431#5131 Thanks @pcorpet! - Avoid referencing an ID that is not in the DOM7184d538#5082 Thanks @Methuselah96! - Fix type inference for Async's loadOptions propbd4ee8ae#5057 Thanks @Rall3n! - Prevent transition props from being forwarded to<input>element inDummyInputcomponentv5.2.2Compare Source
Patch Changes
940a50b1#4928 Thanks @Methuselah96! - Fix usage with esModuleInterop disabled54f9538e#4941 Thanks @prichey! - Use React's AriaAttributes type directly rather than recreatinge97d45c0#4908 Thanks @vjee! - Make 3rd argument of CommonProps['setValue'] optional.v5.2.1Compare Source
Patch Changes
f172d7f9#4886 Thanks @Akridian! - Hooks for creation of custom Selects are now exported from main entryv5.2.0Compare Source
Minor Changes
6c7a3d1e#4785 Thanks @Rall3n! - AddprevInputValueto action metab522ac65#4860 Thanks @ebonow! - Fix animated MultiValue transitions when being removed and change method used to generate unqiue keys for Option components. Closes #4844 , closes #4602Patch Changes
417e7217#4842 Thanks @Methuselah96! - Remove src directory from published package480ea85b#4846 Thanks @Methuselah96! - Add missing index to MultiValue props typeb8e34472#4854 Thanks @mikunpham! - Make input container css re-compute whenever input value changes due to a bug from@emotion/reactin development env.v5.1.0Compare Source
Minor Changes
8b38d49b #4807 Thanks @hcharley! - Export AsyncCreatableProps from creatable entrypoint
46eeda1a #4801 Thanks @Methuselah96! - Export more types from main entry point
Patch Changes
fdd01e66 #4833 Thanks @ebonow! - Value container display property should be grid when isMulti and has no value so the Placeholder component is positioned correctly with the Input
0937604f #4823 Thanks @mikunpham! - Fix the issue where input contents are moved to the left due to multiple space characters.
ec80b577 #4803 Thanks @Methuselah96! - Import CSSObject from @emotion/react instead of @emotion/serialize
v5.0.0Compare Source
Upgrade Guide
Summary
react-selectso you no longer need to have@types/react-selectinstalled; we no longer include Flow typesforwardReffor all wrapped components (#4489) - this means that if you were accessing anything on theSelectinstance using aref, therefwill now reference the internalSelectdirectly (see below for how to upgrade)Selects (i.e.,makeCreatableSelect,mangeState,makeAsyncSelect) these have now been replaced by hooks (i.e.,useCreatable,useStateManager,useAsync).prefix__inputnow targets the input and NOT the containerSelectsreadonlyattribute on ourDummyInput(#4634) - this results in better accessibility but usescaret-colorwhich is not available on IE11Details
Convert to TypeScript
We've rewritten
react-selectin TypeScript which means you can remove any dependencies on@types/react-select. If you were using the Flow types than look into contributing types for v5 toflow-typed.Here are the most notable changes when replacing
@types/react-selectwith our packaged types:OptinTypeBasegetOptionValueandgetOptionLabel) so there's no longer a base type for optionsOptionsTypeOptionsGroupTypeBaseGroupBaseGroupedOptionsTypeReadonlyArray<Group>ValueTypeOnChangeValueInputActionTypesInputActionNamedPropsPropsSelect(thereftype)SelectInstanceforwardReffor all wrapped components" for more detailsAsyncSelect(thereftype)SelectInstanceforwardReffor all wrapped components" for more detailsCreatableSelect(thereftype)SelectInstanceforwardReffor all wrapped components" for more detailsAsyncCreatableSelect(thereftype)SelectInstanceforwardReffor all wrapped components" for more detailsIf you were previously importing a type from the
srcdirectory when using@types/react-select:These should now be imported from the
dist/declarations/srcdirectory:We export any types from the main entry point that we think might be useful to the user. If you are using a type that is not exported from the main entry point please open a PR or issue so that we can add it.
If you are using custom props for the
Selectcomponent you can use module augmentation to add them to theSelectprop types:Drop IE11 support
This allows us to use modern CSS in order to improve the quality of
react-selectand remove excessive JavaScript code to work around not having the ability to use modern CSS. If you need IE11 support either:readonlyattribute on ourDummyInput" since you can't override theDummyInputcomponent with the Styles or Components API.react-selectcompatible with IE11, open a PR. We are unlikely to provide official support for IE11 since supporting IE11 makes maintainingreact-selecta lot more difficult and holds us back from changes we want to make, but we also are glad to accept simple changes if they make your life easier.Use
forwardReffor all wrapped componentsNOTE: Accessing any of the internals of the
Selectcomponent usingrefs is not part of our public API. The internals of theSelectcomponent can change at any time (including in minor and patch releases). The only methods on theSelectcomponent that are part of the public API are thefocus()andblur()methods.react-selectexports five components:BaseSelect,CreatableSelect,Select(the default export),AsyncSelect,AsyncCreatableSelect. The last four components are wrappers around theBaseSelect. Previously thereffor each of these components was pointing to itself, but now we useforwardRefwhich means that therefs for all five components now point toBaseSelect.The
focus()andblur()methods are untouched by this change. However if you were accessing the internals of theBaseSelectcomponent, you will need to update how you were accessing theBaseSelect. Here is how to update access to theBaseSelectcomponent:BaseSelectrefrefCreatableSelectref.select.selectrefSelectref.selectrefAsyncSelectref.select.selectrefAsyncCreatableSelectref.select.select.selectrefReplace HOCs with hooks
The primary reason for this change is that hooks combined with generic components are easier to type in TypeScript than HOCs combined with generic components. These HOCs/hooks are considered advanced usage.
If you were using the HOCs, it shouldn't be too hard to replace them with its corresponding hook (i.e.,
useStateManager,useCreatable, oruseAsync). As an example, here is how the state managed Select (the default export) used to be constructed with themangeStateHOC:With hooks it is now constructed like this:
Consult the source code for how the other components are constructed.
Remove dependency on AutosizeInput
This is an exciting change because we get to drop our dependency on
react-input-autosize. We now use a pure CSS solution to auto-size the input, however this means that we have to drop support for IE11 since IE11 does not fully support CSS grid. As part of this refactor the.prefix__inputCSS class now targets the input itself and NOT the container. See #4625 for more details.Improve screen reader experience
The following improvements have been made for screen reader users:
Also we've added the role of combobox and the required ARIA attributes to the
InputandDummyInputcomponents to allow JAWS support and a better screen reader experience overall. See #4695 for more details.Use CSS grid for single value layout
Previously the absolution positioning of both the value and the placeholder pulled them out of the flow, and thus the component itself collapsed down when used as a flex child. To solve this we are now using CSS grid for the single value layout.
Remove
readonlyattribute on ourDummyInputPreviously we added the
readonlyattribute to theDummyInput(whenisSearchableis set tofalse) in order to hide the flashing cursor and prevent devices from showing a virtual keyboard. However thereadonlyattribute causes theDummyInputto be removed from the tab order in iOS Safari. In order to solve this we're replacing thereadonlyattribute with setting thecaret-colorCSS prop (which IE11 does not support) totransparentand setting theinputModeattribute on the<input>tonone.Changelog
Major Changes
ef87c3ac #4683 Thanks @Methuselah96! - React-Select has been converted from Flow to TypeScript.
Other changes for v5 include usage of
forwardRef, new hooks forstateManager,asyncandcreatablecomponents, and more reliable filtering implementaion with new options in the creatable variant.Patch Changes
10225290 #4720 - Updated the layout for the singleValue input/placeholder/container so that it works better when used in flex layouts.
53f1972b #4731 Thanks @JedWatson! - MultiValue key now includes a hyphen between the value and the index to prevent edge cases where you could get a duplicate key error
b41f4ceb #4704 Thanks @Rall3n! - Fix findDOMNode deprecation by adding refs to transition components
4b028829 #4634 - The readonly attribute has been removed from the DummyInput to improve accessibility
7fcec537 #4697 - Add the role of combobox and the required ARIA attributes to the Input and DummyInput components to allow JAWS support and a better screen reader experience overall.
ca2c0e5b #4756 Thanks @fdcds! - Add
optionfield to type ofCreateOptionActionMeta9e82aadc #4676 - The following improvements have been made for screen reader users:
638f5455 #4702 Thanks @Methuselah96! - The Option generic is no longer required to extend the OptionBase type
23cea0b5 #4782 Thanks @Methuselah96! - Fix type of loadingMessage prop to allow it to return any ReactNode
v4.3.1Compare Source
Patch Changes
v4.3.0Compare Source
Minor Changes
focusedOptionis now passed to the MenuList Component as a propPatch Changes
menuShouldScrollIntoView=falseDocumentation Updates
v4.2.1Compare Source
Patch Changes
v4.2.0Compare Source
Minor Changes
2ffed9c6 #4444 Thanks @Rall3n! - Use accessor props to get value and label in
compareOption2baf5a9d #4414 Thanks @ebonow! - Add
ariaLiveMessagesprop for internationalization and other customizations, addaria-liveprop, 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
c955415c #4437 Thanks @ebonow! - Set event listeners to be non-passive to remove Chrome console warnings
3ca22b2f #3827 Thanks @mitchellhamilton! - Memoize stripDiacritics in createFilter for the input with memoize-one so that stripDiacritics is not called for the same string as many times as there are options every time the input changes
Inspired by https://blog.johnnyreilly.com/2019/04/react-select-with-less-typing-lag.html
dce3863f #4423 Thanks @Methuselah96! - Remove browser alias fields in order to fix SSR apps
ec7c0728 #4443 Thanks @ebonow! - Allow tabIndex prop Type to be number or string
v4.1.0Compare Source
Minor Changes
b5f9b0c5 #4342 Thanks @Methuselah96! - Standardized innerProps and className props on customizable components
19b76342 #3911 Thanks @eugenet8k! - Add
removedValuestoonChangeevent meta when the action isclear(when the user clears the value in the Select)Patch Changes
f600d13f #4422 Thanks @Methuselah96! - Fix finding focusable options for groups
a016c878 #4420 Thanks @Methuselah96! - Bump dependency on @babel/runtime in order to fix compatibility issues with Webpack 5
10b5f5a5 #4404 Thanks @Methuselah96! - Remove unnecessary dependency on @emotion/css
v4.0.2Compare Source
Patch Changes
v4.0.1Compare Source
Patch Changes
v4.0.0Compare Source
Upgrade Guide
Summary
onChange(https://github.com/JedWatson/react-select/pull/4339) - theonChangehandler is now always passed an array of options ifisMultiis set totrueNonceProvidercomponentDetails
Standardize value passed to
onChangeThis change makes it so that the first parameter passed to the
onChangecallback will now always be an array of options ifisMultiis set totrueand will always be a single option ornullifisMultiis set tofalse. Previously the first parameter ofonChangecould be an array ornullwhenisMultiwas set totrue.That means if you were previously using nullish coalescing in order to handle
nullforisMulti:You can now remove the nullish coalescing because
onChangewill always be an array whenisMultiis set totrue:Emotion 11
The
NonceProvidercomponent now requires acacheKeyprop that corresponds to the newly requiredkeyprop for the Emotion cache. This won't affect you if you aren't usingNonceProvider. 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
02050675 #4339 Thanks @Methuselah96! - Standardized value passed to onChange
26b6325c #4283 Thanks @majgaard! - Upgrades Emotion dependency to v11.0.0
BREAKING CHANGE: The NonceProvider component now requires a
cacheKeyprop that corresponds to thekeyfor the Emotion cache.b2488bb5 #4313 Thanks @Methuselah96! - Removed usages of UNSAFE React methods
Patch Changes
v3.2.0Compare Source
Minor Changes
c615e93d #4084 Thanks @JedWatson! - Changed the
cxandgetValueprops 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
ee638d46 #4275 Thanks @Methuselah96! - Adds react ^17.0.0 to peer dependencies for React 17 support
a0133f19 #4154 Thanks @brenshanny! - Creatable: Fixed removing MultiValues that have identical values. See issue #4137 for details.
d1e660c6 #4213 Thanks @eythort! - Added a guard to the
ScrollCaptorcomponent to check thatelexists before callingremoveEventListener, fixes intermittent errorsa1e1db25 #4373 Thanks @Methuselah96! - Fixed value passed to onChange when clearing value
2ad29d61 #4136 Thanks @Methuselah96! - Base aria-live message on tabSelectsValue prop
ad890f27 #4326 Thanks @Methuselah96! - Updated react-input-autosize to v3.0.0
b28d9922 #3990 Thanks @nikitaindik! - Fixed onCreateOption is not always called for Creatable
24ba8702 #4289 Thanks @slimklim! - Added
innerPropsprop to the built-inMenuListcomponent to reduce the need for additional DOM nodes or forking internal code when passing additional props to the DOM element the MenuList component is rendering.See issue #4265 for an explanation.
v3.1.1Compare Source
Patch Changes
c8d74bd5 #3979 Thanks @mitchellhamilton! - Fix repository field
c8447f48 #4034 Thanks @sophiebits! - Improve performance of option filtering when ignoreAccents is enabled (the default)
7af1aafb #4295 Thanks @JedWatson! - Fix menuplacement context
32ad5c04 #3892 Thanks @flexdinesh! - Fix react-select ignoring HTML5 "form" attribute
6af14fbb #3897 Thanks @lorisdev! - Removes the call to
onMenuOpenon every input changeIf you were relying on this undesired behavior it may be a breaking change.
Please upgrade accordingly.
0eb1ef96 Thanks @JedWatson! - Fixes touch issues in IE11
ad608c8f #3928 Thanks @dpordomingo! - Update MenuPlacer context usage in order to the new React Context API
v3.1.0Compare Source
Minor Changes
isLoadingprop support to the AsyncSelect component (see #3690)Patch Changes
textareaelementv3.0.8Patch Changes
indexprop toMultiValuecomponentsrafpackage and replace withwindow.requestAnimationFramebecause React already depends onrequestAnimationFrameloadingMessageandnoOptionsMessageproperties inStylesflow typeclassnamespackagenametoonChangemeta inCreatableto make it consistent with onChange in standardSelectv3.0.6Compare Source
v3.0.3: v3.0.3Compare Source
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
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:
With react-select 3.0.0, and emotion 10 it would be the following:
Multiple Entrypoints:
v3.0.0 separates removes the following components from the main entry point, and instead exports them as separate entrypoints:
Where you’d previously import them as such
Or as:
Now imports look like this:
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

nulland not[].v3.0.2Compare Source
v3.0.1Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.