Fork me on GitHub
#re-frame
<
2021-03-13
>
az23:03:28

Hi all, anyone using re-com? If so, any suggestions on getting a typeahead focusing upon creation? I see in the source there is a TODO to add focus management like this. Any ideas much appreciated.

p-himik23:03:24

Have you tried using a form-3 component with :component-did-mount?

p-himik23:03:31

I.e. wrap the typeahead component into some other component that uses reagent.core/create-class, and in its :component-did-mount handler focus the typeahead component.

az01:03:43

@U2FRKM4TW Thank you, going to try that now. Any ideas on getting at the element to call focus on? In general when trying to get at the sub elements what is the best practice? Do I just find the element using goog and the class name?

p-himik08:03:35

You should use React refs for that.