Workaround for weird JFXComboBox bug

The currency list would show up the list overlay. That gets triggered by unclear reasons.
The bindings on the action and cancel buttons are causing that behaviour (maybe causes some
render cycle which then causes the issue...). By requesting focus on our view directly after
the onTakeOffer updates the bindable properties we can get rid of that UI glitch.
This commit is contained in:
chimp1984 2021-10-23 16:12:05 +02:00
parent 5eec562953
commit 884fe09b25
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -267,6 +267,9 @@ public class BsqSwapTakeOfferView extends BsqSwapOfferView<BsqSwapTakeOfferViewM
log.error(errorMessage);
new Popup().warning(errorMessage).show();
});
// JFXComboBox causes a bug with requesting focus. Not clear why that happens but requesting a focus
// on our view here avoids that the currency List overlay gets displayed.
requestFocus();
return;
}
@ -287,11 +290,18 @@ public class BsqSwapTakeOfferView extends BsqSwapOfferView<BsqSwapTakeOfferViewM
log.error(errorMessage);
new Popup().warning(errorMessage).show();
});
requestFocus();
}).show(model.offer, model.dataModel.getBtcAmount().get(), model.dataModel.getPrice().get());
offerDetailsWindowDisplayed = true;
}
private void requestFocus() {
// JFXComboBox causes a bug with requesting focus. Not clear why that happens but requesting a focus
// on our view here avoids that the currency List overlay gets displayed.
root.requestFocus();
}
@Override
protected void onCancel2() {
close();