Coder Social home page Coder Social logo

Comments (7)

JiuqingSong avatar JiuqingSong commented on July 26, 2024

Can you explain more why you don't want editor to be focused?

from roosterjs.

vhuseinova-msft avatar vhuseinova-msft commented on July 26, 2024

For example I have a situation, when I want to change the default background color and text color. I need to set doNotAdjustEditorColor to true so everything isn't set back to defaults when the theme(dark/light mode) is changed.
But in this case, if the editor wasn't focused before, and I change the theme and use setBackground or setColor functions, the editor will be focused by default.
I think there also may be issues with focus in case if there are a few rooster js editors on the same webpage.

Just to share more info, it's not a blocking issue for me, just wondering if this functionality can be improved.

from roosterjs.

JiuqingSong avatar JiuqingSong commented on July 26, 2024

Do you mean you want to change background color of the editor root DIV?

from roosterjs.

vhuseinova-msft avatar vhuseinova-msft commented on July 26, 2024

These ones:

from roosterjs.

JiuqingSong avatar JiuqingSong commented on July 26, 2024

Not quite understand. LifecyclePlugin is using the down level API setColor to change background color, not setBackgroundColor, they are two different thing.

from roosterjs.

JiuqingSong avatar JiuqingSong commented on July 26, 2024

setBackgroundColor should only be used by ribbon button, when user click on the button to change color of selected text. In that case we expect editor to be focused so user can keep typing.

It should not be used in other case.

For all other cases, you can use the down level API setColor instead.

from roosterjs.

vhuseinova-msft avatar vhuseinova-msft commented on July 26, 2024

I see, thanks for the clarifications! It would be great to have a link for setColor in the documentation for setBackgroundColor (or some other documentation in place) as sometimes it's not very easy to find this kind of documentation withou code checking.

from roosterjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.