summaryrefslogtreecommitdiffstats
path: root/editor/scene_tree_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r--editor/scene_tree_dock.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 2a39b11815..5ebce90626 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -160,11 +160,12 @@ void SceneTreeDock::shortcut_input(const Ref<InputEvent> &p_event) {
}
if (ED_IS_SHORTCUT("scene_tree/rename", p_event)) {
- // Prevent renaming if a button is focused
- // to avoid conflict with Enter shortcut on macOS
- if (!focus_owner || !Object::cast_to<BaseButton>(focus_owner)) {
- _tool_selected(TOOL_RENAME);
+ // Prevent renaming if a button or a range is focused
+ // to avoid conflict with Enter shortcut on macOS.
+ if (focus_owner && (Object::cast_to<BaseButton>(focus_owner) || Object::cast_to<Range>(focus_owner))) {
+ return;
}
+ _tool_selected(TOOL_RENAME);
#ifdef MODULE_REGEX_ENABLED
} else if (ED_IS_SHORTCUT("scene_tree/batch_rename", p_event)) {
_tool_selected(TOOL_BATCH_RENAME);