Skip to content

Fix: reset search filter input after adding selected entity data#707

Open
xetra11 wants to merge 1 commit intoKaijuEngine:masterfrom
xetra11:fix_entity_data_selection_cleanup
Open

Fix: reset search filter input after adding selected entity data#707
xetra11 wants to merge 1 commit intoKaijuEngine:masterfrom
xetra11:fix_entity_data_selection_cleanup

Conversation

@xetra11
Copy link
Copy Markdown
Contributor

@xetra11 xetra11 commented Apr 19, 2026

In order to get access to the search field element I needed to invoke a weak pointer to workspace. However I don't feel that's the intended way to have access to another element inside an element action callback.
@BrentFarris
Maybe you can direct me to a kaiju conventional way?

entitySearchFilter, ok := dui.workspace.Value().Doc.GetElementById("entitySearchFilter")
if ok {
entitySearchFilter.UI.ToInput().SetText("")
}

@xetra11 xetra11 changed the title Reset search filter input after adding selected entity data Fix: reset search filter input after adding selected entity data Apr 19, 2026
@BrentFarris
Copy link
Copy Markdown
Contributor

BrentFarris commented Apr 20, 2026

In order to get access to the search field element I needed to invoke a weak pointer to workspace. However I don't feel that's the intended way to have access to another element inside an element action callback.

The current flow, at the moment, for these UI elements is to store a reference to that UI element in the setup function. Then you'll just have it as a member of the object and won't need to pull it from the DOM.

This adds another member, but that's fine since there is only ever 1 of this particular struct created.

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.

2 participants