openwebwork/mathquill

space after comma inside a group

Closed this issue · 1 comments

Suppose you want to type (1, 2) in MathQuill. Out of habit, you include the space after the comma. After typing (1, you see:

Screenshot 2024-01-04 at 8 34 48 PM

with the cursor outside the suggested close paren. And if you type the 2) you see:

Screenshot 2024-01-04 at 8 36 31 PM

Can space be interpreted in a way so the cursor does not step outside the parens?

This is caused by the spaceBehavesLikeTab option that is enabled by default for webwork2 and pg. Currently that option only has effect when inside a MathQuill block (i.e., at a block depth greater than zero). That was the work around that was added that allows spaces to be used in general, but not in things like square roots and such. That also applies to Bracket objects (including parentheses), so a space typed in a parentheses exits the parentheses block (placing the cursor after the closing parenthesis).

It may be possible to add a case to deal with typing a space after a comma inside a parenthesis. Although, will probably be a bit messy.