onClick state argument API- selectedHtml Issue | Community
Skip to main content
June 26, 2025

onClick state argument API- selectedHtml Issue

  • June 26, 2025
  • 3 replies
  • 442 views
Hi, We are working on Content Fragment Editor extension. Using onClick state argument API, When we try to log the state. selectedHtml is returning only text not in HTML format. Please give some suggestion on this if anyone faced same issue. Reference:https://developer.adobe.com/uix/docs/services/aem-cf-editor/api/rte-toolbar/
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

SalmaSh2Author
June 26, 2025

Reference screenshots

MukeshYadav_
Community Advisor
Community Advisor
June 30, 2025

Hi @salmash2 ,

To get the html content we need to call state.html method as mentioned in doc


Thanks

SalmaSh2Author
June 30, 2025

Hi @mukeshyadav_ , 

state.html is providing the full html of field, it is not providing the html of only selected Text.

kautuk_sahni
Community Manager
Community Manager
July 9, 2025

@salmash2 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni