Adding a better way of getting the best matching node when we are working with a position of the caret and not a selection interval.Just changing the users to fix the issueFix #8887