Only try to wrap the element if it's not disconnected, fixed #3828.