arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.56k stars 277 forks source link

Menu shouldn't display when clicking other math field element #2356

Closed MizarZh closed 5 months ago

MizarZh commented 5 months ago

Description

If multiple math field elements exist and at least two of them are on the same page, one can open the menu of the upper math field and select the lower math field or open menu anywhere. There is also a weird overlay problem with firefox.

Steps to Reproduce

  1. Stack a bunch of math fields in vertical direction
  2. Right click the first math field element to open the menu
  3. Select the element lower than the menu. Or right click other math fields to open up more menus.
  4. In firefox, the element below the menu will be shown.

Actual Behavior

https://github.com/arnog/mathlive/assets/52587907/987a6a6d-8d33-46f1-8af4-39bd7feff1ef

Expected Behavior

When selecting other math field element, the menu should not display, it should behave like selecting other element.

Environment

MathLive version 0.98.6

Before version 0.98.1, the problem still exists, but there will be only one selection.

Operating System Windows

Browser Edge, Firefox

mgreminger commented 5 months ago

This was fixed by #2290. The 0.98.6 release does not yet include this fix.

MizarZh commented 5 months ago

This was fixed by #2290. The 0.98.6 release does not yet include this fix.

Thanks for the fix. It's also possible to fix it by setting the css to work in this version:

math-field::part(container) {
  isolation: auto;
}