Coder Social home page Coder Social logo

Comments (3)

romanisa avatar romanisa commented on June 12, 2024

@vhuseinova-msft Would you like to contribute a fix for this? RoosterJS core team encourages open-source contribution.

from roosterjs.

vhuseinova-msft avatar vhuseinova-msft commented on June 12, 2024

Hi @romanisa! I investigated this issue a little bit and not sure if it's possible to fix it with the current behavior.

To share more details:
Currently, Watermark plugin adds a watermark every time when the editor isn't focused and doesn't have any text. As RoosterJS editor component doesn't really know about existence of rich text format buttons, every time when there is no text in the editor and any rich text format button is clicked, editor looses focus and the watermark is shown (there are quite a few events are caught by onPluginEvent func during this time). The watermark is removed in a few milliseconds because the editor gains focus again which is caused by rich text format buttons onClick callbacks.

A few possible solutions that might need more discussions:

  • change the behaviour of the watermark and start to show it when the editor is focused but empty (quick solution)
  • review the events handling to handle events in more optimal and fast way (probably a big task and I'm not sure if it's even doable)

Please let me know if there is something else that I've missed
cc @JiuqingSong

from roosterjs.

JiuqingSong avatar JiuqingSong commented on June 12, 2024

Please try the new Watermark plugin with ContentModel in demo site. It has fully changed the behavior.

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.