Skip to content

Commit 243f782

Browse files
authored
Merge pull request #3008 from psiservices-uwidmark/master
Ensure a variant is set, otherwise font changes are ignored
2 parents a07ca15 + bfc9870 commit 243f782

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/modes-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function variantString(atom: Atom): string {
134134
if (!style) return '';
135135

136136
let result = style.variant;
137-
if (result === undefined) return 'normal';
137+
if (result === undefined) result = 'normal';
138138

139139
if (
140140
![

src/editor-mathfield/styling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export function defaultInsertStyleHook(
205205

206206
if (model.mode === 'math') {
207207
const atom = model.at(bias === 'right' ? info.after : info.before);
208-
if (!atom) return mathfield.defaultStyle;
208+
if (!atom) return { variant: 'normal', ...mathfield.defaultStyle };
209209
// Merge inherited style with defaultStyle, where defaultStyle takes precedence
210210
return { ...atom.style, variant: 'normal', ...mathfield.defaultStyle };
211211
}

0 commit comments

Comments
 (0)