* Tree: fix #15538 by adding more detect logic. * Tree: fix #15538 and add test case. * Tree: fix eslint error * Tree: remove arrayContains function