TIMath23 / TIM

TIM (The Interactive Material) is an open-source cloud-based platform for creating interactive learning documents.
https://tim.education/view/about/en-US
MIT License
0 stars 0 forks source link

Fix preview click formula change not working sometimes #222

Open juanrein opened 1 year ago

juanrein commented 1 year ago
$$
1
$$

$$
2
$$
  1. Open first formula and modify it
  2. click second formula in preview
  3. press ok

actual behaviour: second formula is not opened expected behaviour: second formula is opened

Seems to be caused by the fact that submitting the formula rerenders the preview html which causes that the clicked element doens't exist anymore.

Could possibly be solved by saving the relevant information from preview before everytime formula editor is opened. If cancel happened then editor content afterwards should be the same as it was before editing started.

Clicked element doens't exist anymore but it could be mapped to itself by assuming that there are same amount of formulas and they are in same order so picking formula from preview with same order should be the right one.