Comments (4)
the same in this example https://codesandbox.io/p/devbox/chakra-autocomplete-demo-jrk70
![Screenshot 2023-12-28 at 7 19 05 PM](https://private-user-images.githubusercontent.com/28817316/293256040-f7c9a32d-7a27-412a-9705-acd9861dc2da.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MDQ4OTksIm5iZiI6MTcxOTQwNDU5OSwicGF0aCI6Ii8yODgxNzMxNi8yOTMyNTYwNDAtZjdjOWEzMmQtN2EyNy00MTJhLTk3MDUtYWNkOTg2MWRjMmRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDEyMjMxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmOTZiYTE0ZTVjYjdhZDgzNWE4N2IzYTVhNmI5MzdlODBlMjQyYzI2YmJlNzhkZGU1YzJiZGMwMGU2NGUxNmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nv1r1wSwNfzyPZgYf9-l-CxxuEXBpjGaYqxPgB4M2OQ)
from choc-autocomplete.
Hi @Hagriel !
If you add restoreOnBlurIfEmpty={false}
to the AutoComplete
component, it will change this behavior. Below is an updated version of the component you're seeing in that codesandbox. Let me know if that works for you and I'll close this issue. If not, let me know how I can help and I'll take another look.
export default function App() {
const countries = [
"nigeria",
"japan",
"india",
"united states",
"south korea",
];
return (
<Stack direction="column">
<Text>Multi select with tags</Text>
<AutoComplete openOnFocus multiple onChange={(vals) => console.log(vals)} restoreOnBlurIfEmpty={false}>
<AutoCompleteInput placeholder="Search..." variant="filled">
{({ tags }) =>
tags.map((tag, tid) => (
<AutoCompleteTag
key={tid}
label={tag.label}
onRemove={tag.onRemove}
/>
))
}
</AutoCompleteInput>
<AutoCompleteList>
{countries.map((country, cid) => (
<AutoCompleteItem
key={`option-${cid}`}
value={country}
textTransform="capitalize"
_selected={{ bg: "whiteAlpha.50" }}
_focus={{ bg: "whiteAlpha.100" }}
>
{country}
</AutoCompleteItem>
))}
</AutoCompleteList>
</AutoComplete>
</Stack>
);
}
from choc-autocomplete.
Hi @Kysluss
It's works
Thank you
from choc-autocomplete.
Not a problem at all. I'll go ahead and close this issue for now, but feel free to open a new one if anything else pops up.
from choc-autocomplete.
Related Issues (20)
- Update package.json for types declaration ? HOT 1
- sslint: cannot find module umd.js HOT 5
- Why has react-nanny become a peer-dependency? HOT 1
- Contribution instructions should use npm HOT 1
- Reset items after submission HOT 5
- tabbing out of autocomplete input selects the focused item in multiple mode HOT 2
- Filling the component programmatically HOT 2
- The `value` prop does nothing HOT 2
- bug: setting AutocompleteItems dynamically via state does not trigger a re-render, only after refocus rendered HOT 2
- Pressing enter when the autocomplete text box is closed selects the first entry, even when freeSolo is true HOT 2
- Named export error HOT 7
- Weird query behavior HOT 1
- How to remove Pop Over "No Results Found" HOT 4
- How to reset this single-select Autocomplete component? HOT 7
- Help with custom filter HOT 1
- Autocomplete is showing a match if the 7 last char are equal even if the "x" other are not HOT 4
- Expose Chakra Popover 'matchWidth' prop HOT 1
- Keyboard navigation causes window to scroll in some configurations HOT 3
- Styling of 'No options found!' message HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from choc-autocomplete.