Using setSelectedDataAsync on multiple lines will result in different format
Opened this issue · 1 comments
Your Environment
- Platform: PC desktop and Office on the web
- Host: Outlook web and "New Outlook"
- Operating System: Windows
- Browser (if using Office on the web): Edge
Expected behavior
When using setSelectedDataAsync with text Coercion Type the inserted text should match surrounding text.
Current behavior
The inserted text has a different formatting compared to the surrounding text
Steps to reproduce
Select multiple lines when composing an Email.
Use the function blow to replace the selected text.
Office.context.mailbox.item?.body.setSelectedDataAsync(
"Text to insert",
{
coercionType: Office.CoercionType.Text,
}
);
Example
The issue is demonstrated in this video, where you can see the different formatting.
https://github.com/OfficeDev/office-js/assets/68271198/d31ff563-4615-435d-9f1e-2ce90a0702fc
Provide additional details
If you only select one line of text it will have to correct formatting, it's only an issue when selecting multiple lines.
It seems when selecting multiple lines the text is put outside the
Thanks for reporting. We have put this issue in our backlog but unfortunately we donot have any timelines to share at this point.
Internal tracking id: 4623257