From 8ee9f5b186f6f02fa2f70c2b414eefad894b79ce Mon Sep 17 00:00:00 2001 From: Inao0 <37711386+Inao0@users.noreply.github> Date: Fri, 28 Jun 2024 16:01:55 +0200 Subject: [PATCH 1/2] Fix #16699 by setting the keyboard focus after the window is opened. There is something weird on SpTextInputFieldPresenter. In SpTextInputFieldPresenter>>takeKeyboardFocusWithoutSelecting the comments state "Unlike `takeKeyboardFocus` this method will not select the text inside." however SpTextInputFieldPresenter>>takeKeyboardFocus does not select by default, hence the additional selectAll in the implementation. From 6cb44cb4d02e9127ba836b949a4a10c0b3095e20 Mon Sep 17 00:00:00 2001 From: Inao0 <37711386+Inao0@users.noreply.github> Date: Sat, 29 Jun 2024 13:01:27 +0200 Subject: [PATCH 2/2] See previous commit message. Fix #16699 --- src/Refactoring-UI/StMethodNameEditorPresenter.class.st | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Refactoring-UI/StMethodNameEditorPresenter.class.st b/src/Refactoring-UI/StMethodNameEditorPresenter.class.st index 64457cdc6b3..1d75b20cad5 100644 --- a/src/Refactoring-UI/StMethodNameEditorPresenter.class.st +++ b/src/Refactoring-UI/StMethodNameEditorPresenter.class.st @@ -353,7 +353,8 @@ StMethodNameEditorPresenter >> initializeDialogWindow: aModalPresenter [ ifNil: [ '' ] ifNotNil: [ :selector | ' : "', selector, '"' ]); addButton: 'Cancel' do: [ :presenter | presenter beCancel; close ]; - addDefaultButton: 'Rename' do: [ :presenter | self renameMethodAndClose: presenter ] + addDefaultButton: 'Rename' do: [ :presenter | self renameMethodAndClose: presenter ]; + whenOpenedDo: [ selectorInput takeKeyboardFocus; selectAll ] ] { #category : 'initialization' }