Small performance tweak

We only need to find the first menu in the scope of `element`, no need
to keep traversing the DOM after we’ve found it.