Office-js: insertHtml on IPad inserts empty content control

Created on 18 Feb 2019  路  1Comment  路  Source: OfficeDev/office-js

I was trying to insert html into the office365 word document and using insertHtml method. insertHtml inserts an empty content control (shows placeholder instead of html).

A problem can be reproduced on iPad iOS 11.3 browsers Safari and Chrome. Native word application on the iPad and other devices (linux, windows, mac - office365 and native word) are inserting correctly.

Code example:

Word.run(async context => {
  const currentRange = context.document.getSelection();
  const control = currentRange.insertContentControl();
  control.insertHtml(
    '<b>Insert any text to test</b>',
    Word.InsertLocation.replace,
  );
  await context.sync().catch(console.error);
})

Same question created on stackoverflow: https://stackoverflow.com/questions/54592210/inserthtml-on-ipad-inserts-empty-content-control

Any help would be appreciated.

fix pending

Most helpful comment

Thanks @rimadu for your message, we have created a bug (#3171568) to track this issue, based on quick investigation the root cause is in word online. we are trying to ask word online team to investigate this issue, will keep you update once we have. Thanks

>All comments

Thanks @rimadu for your message, we have created a bug (#3171568) to track this issue, based on quick investigation the root cause is in word online. we are trying to ask word online team to investigate this issue, will keep you update once we have. Thanks

Was this page helpful?
0 / 5 - 0 ratings