Skip to content

Commit fa6d2f2

Browse files
authored
Merge pull request #33 from apple1417/master
fixed showing options box during on select
2 parents 576d1af + ecb9a12 commit fa6d2f2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
> - Added a `_get_address` method to `WrappedArray`, `WrappedMulticastDelegate`, and `WrappedStruct`.
3030
3131
### UI Utils v1.1
32-
- Linting fixes.
32+
- Fixed some oddities that occurred if you re-showed an `OptionBox` during it's `on_select`
33+
callback.
3334

3435
### [unrealsdk v1.7.0](https://github.com/bl-sdk/unrealsdk/blob/master/changelog.md#v170)
3536
> - `unrealsdk::unreal::cast` now copies the const-ness of its input object to its callbacks.

src/ui_utils/option_box.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,16 @@ def _paging_on_select(self, _: Page, button: OptionBoxButton) -> None:
242242
elif button == self._prev_page:
243243
self._page_up()
244244
elif self.on_select is not None:
245-
self.on_select(self, button)
245+
self._hide_page()
246246
self._pages.clear()
247+
self.on_select(self, button)
247248

248249
def _paging_on_cancel(self, _: Page) -> None:
249250
"""Cancel handler for the paging system."""
251+
self._hide_page()
252+
self._pages.clear()
250253
if self.on_cancel is not None:
251254
self.on_cancel(self)
252-
self._pages.clear()
253255

254256
def _paging_on_input(
255257
self,

0 commit comments

Comments
 (0)