Fix crash when hitting escape while a slider is focused

This commit is contained in:
MysterD 2022-08-07 22:36:35 -07:00
parent cadaf78699
commit cfcef655e6
2 changed files with 7 additions and 0 deletions

View File

@ -329,6 +329,11 @@ void djui_base_destroy(struct DjuiBase* base) {
gDjuiHovered = NULL;
}
// remove focus
if (gInteractableFocus == base) {
gInteractableFocus = NULL;
}
// remove binding
if (gInteractableBinding == base) {
gInteractableBinding = NULL;

View File

@ -136,5 +136,7 @@ struct DjuiSlider* djui_slider_create(struct DjuiBase* parent, const char* messa
base->get_cursor_hover_location = djui_slider_get_cursor_hover_location;
slider->base.interactable->update_style = NULL;
return slider;
}