Fix selector callback patching
This commit is contained in:
parent
d5fdb2a7c5
commit
3a93ddce65
1 changed files with 2 additions and 1 deletions
|
|
@ -272,10 +272,11 @@ namespace psemek::ui
|
|||
};
|
||||
|
||||
auto patch_callback = [&](struct selector * target){
|
||||
target->on_selected([close, cb = target->on_selected()](std::size_t index){
|
||||
target->on_selected([target, close, cb = target->on_selected()](std::size_t index){
|
||||
close();
|
||||
if (cb)
|
||||
cb(index);
|
||||
target->on_selected(cb);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue