Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Control contentControlExited event inconsistent across platforms #4492

Open
AndyHolt opened this issue May 22, 2024 · 4 comments
Open
Assignees
Labels
Area: Word Issue related to Word add-ins

Comments

@AndyHolt
Copy link

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.

@keyur32 keyur32 added the Area: Word Issue related to Word add-ins label May 23, 2024
@shanshanzheng-dev shanshanzheng-dev self-assigned this May 24, 2024
@shanshanzheng-dev
Copy link

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.

@jipyua
Copy link

jipyua commented May 27, 2024

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.

@jipyua
Copy link

jipyua commented May 29, 2024

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.

@AndyHolt
Copy link
Author

Great, thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Word Issue related to Word add-ins
Projects
None yet
Development

No branches or pull requests

5 participants