Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying foreground color via applyStyle doesn't work when value is empty #2261

Closed
truebluepl opened this issue Jan 15, 2024 · 0 comments
Closed
Assignees
Labels

Comments

@truebluepl
Copy link

Current behaviour.

When applying style (in this issue is foreground color) via applyStyle to the empty field and typing some text, text stays in default color.

Expected behaviour.

applyStyle should be able to change style for the future editing.

window.addEventListener('DOMContentLoaded', function() {
  let field = document.createElement("math-field");
  //field.value = '2+2=4'; //uncommenting this causing applyStyle working
  field.addEventListener('mount', function(e){
    field.applyStyle({color:'#ff0000'},{range:[0,-1]});
  });
  document.body.appendChild(field);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants