Comments (4)
Thank you for letting us know about this issue. We will take a look shortly. Thanks.
from office-js.
hi @greysteil thanks for let us know this issue. But unfortunatelly with the following code, I can't reproduce the issue you mentioned, undo/redo is working correctly if I inserted a comment on each of more than 6 paragraphs using the following code. Can you help confirm what's the missing information? thanks.
const pars = context.document.body.paragraphs;
pars.load();
await context.sync();
for (var i=0; i<pars.items.length; i++)
{
pars.items[i].getRange().insertComment("abc");
}
await context.sync();
console.log("comments inserted");
from office-js.
Oh interesting - I thought this was any time four or more comments were inserted, but it looks like there are some caveats.
@jipyua can you replicate that Word hangs when undoing the following?
Word.run(async (context) => {
myLoc = context.document.body.paragraphs.getFirst().getRange("Content")
// myLoc = context.document.body.getRange().search("some text").getFirst()
for (var i=0; i<4; i++) {
myLoc.insertComment("abcde");
}
await context.sync();
console.log("comments inserted");
})
That's the simplest snippet that causes the problem for me. A couple of notes:
- The comments have to be 5 characters or longer (hence
abcde
). Undo works fine if they're shorter. In reality, almost all comments are 5 characters or longer, so this doesn't help our users. - I have to narrow the paragraph's range by passing
"Content"
togetRange
to get the bug. Undo works fine if I don't specify that. Again, in reality, most production use cases insert comments based on asearch(...)
result, which gives ranges that don't include the end of paragraph break.
I've included a commented out line of code that replicates the bug in the more common case where the location you're commenting on comes from search(...)
. It expects the doc you're running on to have the words "some text" in the document body.
from office-js.
Thanks for sharing the detailed code, I am able to replicate the issue you mentioned earlier and have opened an internal item 9072602 to track this. We will triage the priority based on the impact and severity and share here if we have some progress. thanks.
from office-js.
Related Issues (20)
- How to use workbox in Excel Addin HOT 3
- Access custom spam reporting features in other menus HOT 1
- In a custom Spam reporting add-in, microsoft defender is not triggered HOT 1
- Custom function "error installing functions" via Admin Managed. Working on Local and Sideload HOT 21
- Get username of current user HOT 3
- Spam addin event.options is an array in classic outlook and is an object/structure in browsers/new look outlook. HOT 1
- Outlook 365 add-in not loading on MAC/OS new Outlook app. HOT 8
- Powerpoint Add-in is not updating automatically without any notification HOT 5
- Custom function handling of Entity Value is broken again HOT 4
- Office.context.roamingSettings.get() size limit HOT 2
- Word close API not working HOT 3
- Excel close is not working HOT 10
- Powperpoint close API HOT 4
- Manifest file sideloads on Excel web but does not sideload on Mac or Windows os HOT 2
- Opening dialog in iframe for an Excel custom function handler fails on alternate invocations HOT 6
- Outlook Add-in - Call to mailbox.getUserIdentityTokenAsync returning undefined token for only some Outlook accounts
- Assistance Needed with Outlook Add-In installing Manifest for older version of Outlook HOT 1
- MIME parts returned by getAsFileAsync() don't include Content-Disposition on Outlook Win32
- Permission under manifest file HOT 5
- Content copy pasted as table not being considered as body text using getAsync(Office.CoercionType.Text) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js.