Skip to main content
Jun 26, 2025 10:28 AM UTC

onClick state argument API- selectedHtml Issue

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.

4 replies

SalmaSh2Author
Jun 26, 2025 10:29 AM UTC

Reference screenshots

Translate
MukeshYadav_
Community Advisor
Community Advisor
Jun 30, 2025 12:38 PM UTC

Hi @salmash2 ,

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


Thanks

Translate
SalmaSh2Author
Jun 30, 2025 1:05 PM UTC

Hi @mukeshyadav_ , 

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

Translate
kautuk_sahni
Level 9
Jul 9, 2025 7:46 AM UTC

@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!

Translate
Kautuk Sahni