Skip to content

Commit

Permalink
fix: fixed #2227
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Dec 22, 2023
1 parent 9d38498 commit 31d520a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/public/mathfield-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,17 @@ export class MathfieldElement extends HTMLElement implements Mathfield {

// Record the (optional) configuration options, as a deferred state
if (options) this._setOptions(options);

this.shadowRoot!.addEventListener('slotchange', () => {
const slot =
this.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])');
this.value =
slot
?.assignedNodes()
.map((x) => (x.nodeType === 3 ? x.textContent : ''))
.join('')
.trim() ?? '';
});
}

showMenu(_: {
Expand Down

0 comments on commit 31d520a

Please sign in to comment.