Skip to content
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

Clicking <InputRightElement> does not expand the <AutoCompleteList> #43

Closed
rahulsuresh-git opened this issue Aug 2, 2021 · 12 comments
Closed

Comments

@rahulsuresh-git
Copy link

image

"@choc-ui/chakra-autocomplete": "^4.3.4"

Clicking the <InputRightElement> isn't doing anything.

@anubra266
Copy link
Owner

Could you reproduce this in codesandbox please?

@rahulsuresh-git
Copy link
Author

Give me some time, I'll get back to you with the link.

@rahulsuresh-git
Copy link
Author

https://codesandbox.io/s/choc-ui-autocomplete-input-right-element-flp5b?file=/src/App.tsx

I have replaced the icon with some text for now but it's pretty much the same behaviour. Clicking the doesn't do anything.

@anubra266
Copy link
Owner

Hi @icy-meteor You don't have any onClick handler on the inputrightelement. What're you expecting it to do onClick.

@rahulsuresh-git
Copy link
Author

I want it to open the dropdown.

@anubra266
Copy link
Owner

Then you have to set an Onclick handler for that

@anubra266
Copy link
Owner

anubra266 commented Aug 4, 2021

Check this out. onOpen and onClose are also exposed as internal state. @icy-meteor

@rahulsuresh-git
Copy link
Author

Yes, I saw this. I couldn't find what is the method exposed to open and close the popup. Neither were there any examples other than isOpen.
Is it onOpen and onClose? That doesn't sound right though.

@anubra266
Copy link
Owner

Yeah it's onOpen and onClose

@rahulsuresh-git
Copy link
Author

rahulsuresh-git commented Aug 4, 2021

Okay, maybe we might want to fix the naming convention :)
onOpen sounds more like a callback that gets fired when something is open. Doesn't sound like something that will trigger an open behaviour.

Thanks for the response. I'll try this out.

@anubra266
Copy link
Owner

anubra266 commented Aug 4, 2021

@icy-meteor onOpen is the default return of Chakra's useDisclosure. and right, it's a callback that gets fired when something gets opened. But the verb open is just like a variable name, so we say, open the list, when the variable open is true.
Besides, changing this will be a breaking change.

And you can close this if it's working well for you.

@rahulsuresh-git
Copy link
Author

LGTM. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants