question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

__isNew__ options always showing even when filtering

See original GitHub issue

Are you reporting a bug or runtime error?

In V5 using creatable and filterable options, when an option has __isNew__: true it will always show in the options, even when filtering.

This issue didn’t exist in v4, and there is no mention of it in the changelog.

This issue is caused by this line: https://github.com/JedWatson/react-select/blob/cfd5d9f632b4a8b699fba1028d3243735428e428/packages/react-select/src/filters.ts#L28

Was introduce by this PR: https://github.com/JedWatson/react-select/pull/4702 Which doesn’t mention this being an indented behaviour.

Video: https://www.loom.com/share/e343c5d9770544c398a3c3d5537c649d

See this video of the difference between React-Select 4 and 5. https://www.loom.com/share/9c7aff61336a475398750539200957a7

Codesandbox: https://codesandbox.io/s/codesandboxer-example-forked-o2wlz?file=/example.tsx

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
Methuselah96commented, Nov 9, 2021

I don’t think we considered multiple Selects sharing the same array of creatable options. The thinking was: what is the use case for not showing the “creatable” option? For example, if the creatable option label did not include the text that the user was typing (e.g., if it was just a fixed label) then it might be unintentionally filtered. The fact that it would be filtered out in that scenario was considered a bug which is why we didn’t categorize it as a breaking change. We’ll discuss this at our maintainers meeting and figure out what we want the intended behavior to be going forward.

0reactions
ro-savagecommented, Jan 25, 2022

Thanks for all your input @Methuselah96

We fixed this on our side some time ago but overwriting the options properties.

I still think the current behaviour doesn’t make a lot of sense - to me a filter should always be applied when you are filtering. Regardless of the isNew property. But I understand you might see it differently.

Happy for this to be closed, if this is going to stay as intended behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Limit Required Lookup Filter to ISNEW or ISCHANGED
If a lookup has a required filter the filter is applied even if the field doesn't change, therefore if a related record changes...
Read more >
Format filters in Power BI reports - Microsoft Learn
This article explains how you can format the Filters pane to look like the rest of the report. You can lock and even...
Read more >
Excel FILTER function with formula examples - Ablebits
See how to filter in Excel dynamically with formulas. Examples to filter duplicates, cells containing certain text, with multiple criteria, ...
Read more >
Model.find Mongoose 6.012 always return all documents even ...
its because you don't have any field in schema named as "anotherField", Always make sure to check your find method filter field or...
Read more >
Adding and editing user-defined dashboard filters | Looker
Customizing filter configuration. Once you select a filter field and click Add, the Add Filter window shows a variety of customizable settings:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found