Fix issue #4693: Tree context menu behaves unpredictably while naming new file

Fix issue #4693: Tree context menu behaves unpredictably while naming new file