fixes #17207: fix Tree openOnDblClick regression

cherry picked from commits:
  - b051fc9586224f2ce67c0f37966a0971052df627
  - 75cf90f06b81c096c36de1a8a9a42838c53d23ed
  - af7db126555b5c6179f00e2bcac7b271c0fde215