Fix SpinBox stepper grabbing focus state on mouse input
This commit is contained in:
@ -257,7 +257,7 @@ void SpinBox::gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
switch (mb->get_button_index()) {
|
switch (mb->get_button_index()) {
|
||||||
case MouseButton::LEFT: {
|
case MouseButton::LEFT: {
|
||||||
accepted = true;
|
accepted = true;
|
||||||
line_edit->grab_focus();
|
line_edit->grab_focus(true);
|
||||||
|
|
||||||
if (mouse_on_up_button || mouse_on_down_button) {
|
if (mouse_on_up_button || mouse_on_down_button) {
|
||||||
// Arrow button is being pressed. Snap the value to next step.
|
// Arrow button is being pressed. Snap the value to next step.
|
||||||
@ -281,7 +281,7 @@ void SpinBox::gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
drag.capture_pos = mb->get_position();
|
drag.capture_pos = mb->get_position();
|
||||||
} break;
|
} break;
|
||||||
case MouseButton::RIGHT: {
|
case MouseButton::RIGHT: {
|
||||||
line_edit->grab_focus();
|
line_edit->grab_focus(true);
|
||||||
if (mouse_on_up_button || mouse_on_down_button) {
|
if (mouse_on_up_button || mouse_on_down_button) {
|
||||||
set_value(mouse_on_up_button ? get_max() : get_min());
|
set_value(mouse_on_up_button ? get_max() : get_min());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user