Skip to content

hotfix for select(index)#369

Open
maksimbykov wants to merge 2 commits into
TarekRaafat:masterfrom
maksimbykov:hotfix_select_by_index
Open

hotfix for select(index)#369
maksimbykov wants to merge 2 commits into
TarekRaafat:masterfrom
maksimbykov:hotfix_select_by_index

Conversation

@maksimbykov
Copy link
Copy Markdown

@maksimbykov maksimbykov commented Aug 31, 2022

Fix #356

@maksimbykov
Copy link
Copy Markdown
Author

@TarekRaafat please review this when you'll have time, thanks❤️

@maksimbykov maksimbykov changed the title hotfix hotfix for select(index) Aug 31, 2022
@AndrewElans
Copy link
Copy Markdown

Any news on this bug?

@AndrewElans
Copy link
Copy Markdown

AndrewElans commented Apr 28, 2023

I guess the reason why this TypeError: Cannot set properties of undefined (setting 'event') is fired is because select(index) is called when function init (ctx) is not yet complete.

I have fixed in my case by placing select(index) in the results event which seems to run after init is finished.

Before I tried to call select(index) on window.load and other events but in vain. Also in init event the same error was generated. I guess that even if the init event is fired, the init promise may still be not returned.

@TarekRaafat
Copy link
Copy Markdown
Owner

Hello @maksimbykov and @AndrewElans,

I apologize for my very delayed reply, and thanks to you and @AndrewElans for following up.

The bug you identified is valid, and I can see how calling select(index) before ctx.feedback is populated causes the TypeError. Good catch on tracing it back to #356.

The current fix of calling start(this, ' ') with a space as query works as a workaround, but I believe we need a more solid approach that does not depend on triggering a search to populate the context. I will address this properly as part of the upcoming v11 release, where the initialization and lifecycle flow is undergoing a broader overhaul.

I will be publishing the v11 release plan soon, so stay connected for updates.

Thanks for your valuable contribution and for your patience, much appreciated!

Have a nice day, cheers! :)

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

Successfully merging this pull request may close these issues.

API Call to select an resultItem is not working

3 participants