desmosinc / mathquill

Magic textboxes where you can type math as easily as writing!
mathquill.com
137 stars 42 forks source link

Fix selection in test/visual.html #237

Closed jwmerrill closed 2 years ago

jwmerrill commented 2 years ago

In 51a75093dac047399e64a0d06a68c937c0df5a3e we accidentally started dispatching the CTRL-A keydown to the first textarea on the page instead of to the #selection-tests text field.

I wasn't previously familiar with the use of the second arg to the $() function, but it's a "context" in which selector will be applied. So I think

$('textarea', this)

is roughly equivalent to

$(this).find('textarea')

Ref:

Reported in https://github.com/desmosinc/mathquill/issues/236

jackschmidt commented 2 years ago

This makes sense and fixes it for me! Thank you!