OfficeDev/office-js

Content Control `contentControlExited` event inconsistent across platforms

Opened this issue · 4 comments

Provide required information needed to triage your issue

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Mac
  • Host [Excel, Word, PowerPoint, etc.]: Word
  • Office version number: 16.85 (24051214)
  • Operating System: macOS
  • Browser (if using Office on the web): Chrome

Expected behavior

When cursor is in a Content Control, using arrow keys to move out of the content control triggers contentControlExited event when cursor leaves the content control

Current behavior

Currently, contentControlExited event is triggered as expected when mouse used to click outside of the content control, but on Word on Mac, using the arrow keys does not consistently trigger the event (it does sporadically). In Office on the Web, both clicking outside and using the arrow keys to move outside the content control consistently trigger the contentControlExited event.

The same appears to be true of contentControlEntered event, though I haven't tested this so rigorously.

Steps to reproduce

  1. Create a content control
  2. In Word Add-On, add function to run when content control exited. E.g.
await Word.run(async (context) => {
    const contentControls = context.document.contentControls;
    contentControls.load("tag")
    await context.sync()

    const eventContexts = []

    if (contentControls.items.length) {
        for (let i = 0; i < contentControls.items.length; i++) {
            eventContexts[i] = contentControls.items[i].onExited.add(() => {console.log("Content control exited!")})
            contentControls.items[i].track()
        }

            await context.sync()
    } else {
        console.log("No content controls found, so can't register event handlers"))
    }

})
  1. From the content control, click outside the content control, exit event fires.
  2. From the content control, use arrow keys to move outside the content control. On Office on the Web, event fires, but on Word on Mac, event does not fire (except sporadically).

Context

Enterprise add-in (Schemeflow) gives inconsistent performance for content controls used throughout documents. This has a significant negative impact on users who find the experience unreliable, impacting adoption and usage of our product.

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

Hi @AndyHolt, Sorry for slow response. We're looking into this problem, thanks for reporting! we will report back here if we have an investigation.

hi @AndyHolt , thanks for reporting this issue. We tried arrow key move and it's true that sometimes the key move around the boundary is not triggering the event (when we move the selection just 1 position outside the content control, acturally this is also true for mouse move). We will update the thread once we found the root cause. Thanks.

hi @AndyHolt , for this issue we have internally made a fix and now it's under the process of validation and deployment rollout. It should be available early next month with the latest M365 office update, please update your Office to the latest and have a try then. Thanks.

Great, thanks very much!