-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Select v2 and the future #2208
Comments
sorry have not read your message before, i've just add a new request future, it's about to allow type values that are not on the list ? by example i need add cities that are not on the list or some lists are not really from a database (have no id) but the important thing it's capture the text, not the id value or key. I don't know if that is planned in V2 , or there is a way I can change the code to be able to use in v1 ? |
I've just pushed the first working implementation into the |
Thanks @JedWatson ! And congratulations for reaching 10000 stars! |
@JedWatson v2 will support async load with pagination? |
I've opened a PR for v2, the preview is available here: https://deploy-preview-2289--react-select.netlify.com/ @webmobiles and @iwollmann I'm not 100% sure on which features will be in v2 yet, but I'm taking into account all of the requests that have come in over the last year including things that we haven't managed to do (or do well) in v1 and am hoping most of them will be supported in the new version. I'll continue to provide more details on changes and new features as development progresses. |
It looks like it has optgroup support? 👍 |
I am planning it, although haven't finalised that part of the API yet (
Sure does, implemented from the get-go 😁
I wrote up a brief to-do list on the PR: #2289 Luckily @jossmac and I've got quite a bit of time to work on this at the moment and I'm hoping to get it shipped before the end of February. Really happy for reviews + feedback at the moment, but I wouldn't want anyone using it in production before the actual |
@JedWatson Do you need any help with v2? I'd love to contribute if there's any low-hanging fruit you can point me at that might be a good starting point. |
Thank you for a great lib! If it is possible, please include |
@Reaverart @JedWatson I have the same request - this library is great, except that the popover section of the Select gets eaten up by components with overflow settings. I get that since all components are replaceable, we could do this ourselves (great feature by the way, I love seeing that in React component libs). But it seems like a lot of users will want this out of the box. If I can find the time I'll submit a PR targeting |
@Reaverart @a-type we're not sure yet whether to ship a portal with the menu, but I'd like to address this common concern. Below is an example using the v2 API: import React, { Component } from 'react';
import Select, { components } from 'react-select';
import { createPortal } from 'react-dom';
const Menu = props => createPortal(
<components.Menu {...props} />,
document.body
);
class MySelect extends Component {
render() {
<Select components={{ Menu }} />
}
} |
@jossmac have you tested that? My understanding of the rendering parameters for the menu indicates that it wouldn't appear in the correct position if it's simply rendered into I have an issue open here proposing the feature: #2398 And I have a branch with working changes on my fork: https://github.com/a-type/react-select/tree/v2-portal-menu Still awaiting discussion or approval of the direction before finishing it all up and submitting a PR. |
@a-type yeah, you'd have to position the menu. I'll have to checkout your branch in more detail, thanks for putting together the issue for discussion 👍 |
@JedWatson @jossmac Will V2 also include typescript definitions? |
@frankievx I'm not keen on maintaining two type definitions, at least not yet. If there's enough demand in the community and someone wants to step up to maintain it, I might be open to it down the track, but right now it would be a burden on our core development and/or get out of date (both of which would be bad) I know this could be disappointing for typescript users and that's a shame, I do wish there was an easy way to maintain both... but at this point I'm optimising for maintainability. |
I'm playing around with alpha6/7, great progress. I'm trying to replicate what |
I'm using v2.0.0-alpha.7 to customise my SelectInput. I am able to add custom styling except those styles that depend on the state. For example option: base => ({
...base,
color: isSelected ? '#fff' : '#000',
}) How do I get the @JedWatson Will these values be available to provide custom styling? |
@JedWatson I'm having a super hard time building the project so I can test it locally. I'm running: yarn build go into my project yarn link react-select First time I did this, my build uses the "main" defined in package.json which resolves to the lib folder and I get the following error:
So I go and I move that main to instead point at build/react-select.js, but then I get this error (also happens when I copy the build locally):
Finally I try build/react-select.es.js
How exactly can I build and test this locally via yarn link. This is really painful to work with. Edit: |
@falconmick that's a pretty hard question to answer blind, I'll do my best. I've had react-select working in linked mode without any issues, but haven't tested in the last couple of weeks so something may have changed 😬 I'm not sure why the problem with I just found and pushed a fix (to the In terms of how best to dev ssr in react-select, actually maybe the easiest way would be to add a really simple SSR script to the react-select repo and include it in the test suite. So maybe That might help with your dev loop, and also make sure that issues with SSR don't creep in with PR's going forward. re: how I build, I'll add that to the readme, it's roughly this:
EDIT I mis-read your comment and just realised that my last push should have fixed the issue blocking you when you change the main entry point to |
re @kpavankotesh those functions take a second argument which is the option: (base, { isSelected }) => ({
...base,
color: isSelected ? '#fff' : '#000',
}) We've done a lot of work on the docs in the last couple of weeks, check them out and let me know if it's still confusing. For everyone else, please open new issues with bug reports or feedback on v2, they're easier to see and respond to than comments on this issue 🙂 |
Saw the latest release and examples. This feature is available now. Thanks 👍 |
@JedWatson the issue of |
@JedWatson i don't know if this is the issue to acummulate all v2 issues but here it goes: When adding Animated component to AsyncSelect i'm getting the following two warnings, ONLY when using isSearchable false:
Hope it helps, it's definetely some combination of isSearchable false with Animated. This is my component:
|
@tommyalvarez from @JedWatson in #2208 (comment)
|
@jfsiii oops, didn't see that. However what does he mean by reporting on v2? Is that a particular PR or something? Could you please provide a link ? Because i know it's not another repository, and in the official v2 doc page there's nothing there. Thanks! |
@tommyalvarez create an issue at https://github.com/JedWatson/react-select/issues/new like you would any other, just be sure to mention that the issue is with v2 code |
@JedWatson , Can we use React-Select v2 Beta for production? Also when can we expect the v2 main release? |
Test it on all browsers you have to support and then make sure your
targeting the exact version of the beta (no ^2.0.0-beta stuff) and then
just accept that your responsible to ensure that it keeps working. By
locking the version and testing it fully it’s as ready as your tests were
extensive.
This is general advice on betas, this beta might be allot more stable than
I’m being paranoid
…On Sat, 23 Jun 2018 at 10:39 AM, Harini03 ***@***.***> wrote:
@JedWatson <https://github.com/JedWatson> , Can we use React-Select v2
Beta for production? Also when can we expect the v2 main release?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2208 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAri6f7plwJd2Hf0YXXg5klAFd5AIHe-ks5t_apYgaJpZM4Q-cW0>
.
|
Comment from @dbertella on #2289
valueThe isDisabledPartly for consistency with other |
@JedWatson @jossmac hi guys, v2 is cool ! when can we expect v2 out of beta, we may use it in production ? |
@testacode you can do that manually like:
See the |
when will onBlurResetsInput props be supported too? looking forward for V2 |
Very happy to announce that v2.0.0 has just been published to npm, and we have a new site: react-select.com Thanks to @gwyneplaine, @Noviny and everyone else who helped with this release. We'll follow up the rest of the feedback separately in individual issues. Hope you all like it! |
You can do something like:
|
I've spent the last few months cleaning up react-select v1 and thinking about the future. Now I'm ready to share some exciting news, and begin discussing plans openly.
The project has grown way beyond my original use-case to become one of the most popular react components: with nearly a million downloads per month, statistically over one in seven people installing
react-dom
also installreact-select
😆Over the years the API has also grown organically to accommodate a huge amount of flexibility and customisation, and I've been reluctant to do much that would break it or invalidate open PRs before they can be reviewed.
On to the news: for the last half-year, with several team members from Thinkmill I've been working with Atlassian to develop their new UI library Atlaskit which is being used in Jira, Stride, Confluence, Bitbucket and many other products. We've had the opportunity to do a lot of deep thinking on component architecture, and are now turning our attention to Select components... which I am hoping to use react-select as the base for.
With that in mind, I'm embarking on a rewrite of the component using these new ideas and much more modern techniques. I've got a working prototype of the new architecture, and from now I'll be working publicly in a
v2
branch. Here's what you need to know:v2
branch is experimental; I'll update here as it evolvesSome specifics:
My goal is that many of the requirements people open issues and PRs for will become easily customisable so they don't require changes to the react-select core. If (if) I get this right, it'll both make the component more useful and also help me stay on top of things as a maintainer. It also opens the potential for an ecosystem of packages and customisations to start developing on top of react-select, instead of the many forks that currently exist.
The text was updated successfully, but these errors were encountered: