Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Ability to select an item from a method (programmatically) #111

Closed
bryanbassett opened this issue Jan 10, 2023 · 2 comments
Closed

Ability to select an item from a method (programmatically) #111

bryanbassett opened this issue Jan 10, 2023 · 2 comments

Comments

@bryanbassett
Copy link

Is there any way to select an item without actually using the autocomplete box? The items selected go into a built in custom component, but I'd either like to use my own - or alternatively be able to use the autocomplete box programmatically.

Am I missing something or is this not possible?

@koolamusic
Copy link
Owner

This is possible using the provided change methods

@koolamusic
Copy link
Owner

 <CUIAutoComplete
            tagStyleProps={{
              rounded: 'full'
            }}
            label="Choose preferred work locations"
            placeholder="Type a Country"
            onCreateItem={handleCreateItem}
            items={pickerItems}
            itemRenderer={customRender}
            createItemRenderer={customCreateItemRender}
            selectedItems={selectedItems}
            onSelectedItemsChange={(changes) =>
              handleSelectedItemsChange(changes.selectedItems)
            }
          />

the section you are looking for is the onSelectedItemsChange method.

Repository owner locked and limited conversation to collaborators Jan 11, 2023
@koolamusic koolamusic converted this issue into discussion #112 Jan 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants