mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 21:11:59 -04:00
Number Button Fix
- Add `is_editing` helper to BaseStringButton - Block left/right input from changing number while typing Resolves #706
This commit is contained in:
@@ -54,7 +54,7 @@ void NumberButton::set_value(Rml::String value) {
|
||||
}
|
||||
|
||||
bool NumberButton::handle_nav_command(NavCommand cmd) {
|
||||
if (cmd == NavCommand::Left || cmd == NavCommand::Right) {
|
||||
if (!is_editing() && (cmd == NavCommand::Left || cmd == NavCommand::Right)) {
|
||||
const int newValue = std::clamp(
|
||||
mGetValue() + (cmd == NavCommand::Right ? mStep : -mStep), mMin, mMax);
|
||||
if (newValue != mGetValue()) {
|
||||
@@ -66,4 +66,4 @@ bool NumberButton::handle_nav_command(NavCommand cmd) {
|
||||
return BaseStringButton::handle_nav_command(cmd);
|
||||
}
|
||||
|
||||
} // namespace dusk::ui
|
||||
} // namespace dusk::ui
|
||||
|
||||
Reference in New Issue
Block a user