Changelog
0.98.3 2023-12-07
Improved contrast calculation for the checkmarks over color swatches, now using APCA.
In some situations, the virtual keyboard would not be displayed when the
mathfield was focused and the mathVirtualKeyboardPolicy
was set to "auto"
.
Changelog
0.98.2 2023-12-06
In some rare cases, the menu was not positioned correctly or would not display at all.
When dynamically changing the layout of the mathfield, for example when using a font-size attribute based on viewport units, correctly redraw the selection
Selection while dragging would stop after a few milliseconds
The "contains highlight" indicator is no longer displayed when the mathfield is not focused or when the indicator is outside of a prompt.
#2194 Ignore long press events when the pointer is a mouse.
#2195 If the mathfield had a variable width the selection would not be displayed correctly.
#2190 Under some circumstances, commands selected from the menu could be executed twice.
Changelog
0.98.1 2023-12-05
mf.showMenu()
method to programmatically show the context menu.Correctly position the menu when the document has been scrolled.
When serializing, do not generate a \text
command around a \texttt
command.
Changelog
0.98.0 2023-12-03
The mf.setPromptContent()
method has been renamed to mf.setPromptValue()
for consistency with the mf.getPromptValue()
method.
The mf.stripPromptContent()
method has been removed. Its functionality can
be achieved with:
const prompts = mf.getPrompts();
const values = prompts.map(id => mf.getPromptValue(id));
prompts.forEach(id => mf.setPromptValue(id, ""));
mf.getPromptRange()
method returns the selection range of a prompt.
This can be used for example to focus a mathfield and select a specific
prompt:mf.focus();
mf.selection = mf.getPromptRange(id);
The Color, Background Color and Variant menus correctly toggle the colors and variant, and reflect their state with a checkmark or mixedmark.
Setting the mf.menuItems
property before the mathfield is inserted in the
DOM will now correctly update the menu items.
Correctly display tooltips in the menu when invoked via the menu icon.
Localized menu items in the context menu.
#348 Added a placeholder
attribute, similar to the placeholder
attribute of a <textarea>
element. This specifies a short hint as a LaTeX
string that describes the expected value of the mathfield. When the mathfield
is empty, the placeholder text is displayed. The placeholder text can be
styled with the math-field::part(placeholder)
CSS selector.
#2162 Added a "latex-without-placeholders"
format to the getValue()
method. This format is similar to the "latex"
format, but does not include
the placeholders (for "fill-in-the-blanks").
#2169 Changing the selection programatically will now correctly update the mathfield.
#2189 If the decimal separator is set to ,
, the virtual keyboard will
now correctly display the decimal separator as a comma.
#2139 On some keyboard layouts, <kbd>ALT</kbd>+<kbd>/</kbd> would insert a
\/
command, which is not standard. Now, the simple /
is inserted.
Changelog
0.97.4 2023-11-29
.row
class was defined, it would be applied to the virtual
keyboard rows, resulting in incorrect layout.mf.queryStyle()
method to query the style of a selection or the
current style if no selection.Changelog
0.97.3 2023-11-28
The mode-change
event is now dispatched more consistently when the mode
changes.
When the mathfield loses focus, if some of the content is in LaTeX mode, it remains in LaTeX mode. Previously, it would switch to math mode when losing focus.
Changing the user-select
CSS property before inserting the mathfield in the
DOM would not always be respected.
Use the DOM Popover API when available, which should ensure menus are displayed on top of other elements more consistently.
Added support for accented characters in the virtual keyboard (press and hold a vowel on an alphabetic keyboard to get accented variants), including a modified AZERTY layout (<kbd>SHIFT</kbd>+digits to get common accented characters).
Improved rendering of the menu for CJK and LTR languages.
If there were multiple mathfield elements on the page, only the last one would display tooltips.
#2184 Pressing the <kbd>TAB</kbd> key when in a prompt (fill-in-the-blank) would not move to the next prompt
#2183 The MathML serialization of factorial was incorrect.
#2181 The MathML serialization of limits was incorrect.
Changelog
0.97.2 2023-11-21
Changelog
0.97.1 2023-11-20
#2180 Allow the context menu to get turned off by setting
mf.menuItems = []
Fixed a layout issue with the positioning of the context menu in some cases.
Improved dark mode appearance of context menu
Changelog
0.97.0 2023-11-20
Context Menu Right-clicking on a mathfield or clicking the menu icon next to the virtual keyboard icon will bring up a context menu.
The keyboard shortcut <kbd>ALT</kbd>+<kbd>SPACE</kbd> will also bring up the context menu. This keyboard shortcut previously toggled the virtual keyboard. This keyboard shortcut to toggle the virtual keyboard is now <kbd>ALT</kbd>+<kbd>SHIFT</kbd>+<kbd>SPACE</kbd>.
The menu includes commands to:
The content of the menu may change in future versions, and feedback is welcome.
The menu can be customized by setting the mf.menuItems
property of the
mathfield. The value of this property is an array of menu items. See
the documentation for details.
\pmod5
is now correctly parsed as \pmod{5}
. Macros that
used an argument that was not a literal group were not parsed correctly.Changelog
0.96.2 2023-11-16
MathfieldELement.locale
or MathfieldElement.strings
would not affect existing mathfields.mf.locale
instead
of MathfieldElement.locale
) will now throw an error.smartFence
was on, an inline shortcut that conflicted with a
delimiter was ignored.\mapsfrom
.user-select
CSS property.
If it is set to none
, the mathfield will not be selectable.