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

Using search(...) throws SearchDialogIsOpen when the advanced search dialog is open #4922

Open
greysteil opened this issue Sep 24, 2024 · 4 comments
Assignees
Labels
Area: Word Issue related to Word add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@greysteil
Copy link

Provide required information needed to triage your issue

Using the search(...) function when a user has the advanced search dialog open throws a SearchDialogIsOpen error.

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Mac, but also observed on PC
  • Host [Excel, Word, PowerPoint, etc.]: Word
  • Office version number: 6.90 (24091721)
  • Operating System: MacOS 14.6.1
  • Browser (if using Office on the web): N/A

Expected behavior

Using search(...) should return results regardless of whether the user has the advanced search dialog open.

Current behavior

Using the search(...) function when a user has the advanced search dialog open throws a SearchDialogIsOpen error.

Steps to reproduce

  1. Open the advanced search dialog
  2. Run a search from an add-in:
    await Word.run(async (context) => {
     let ooxml = context.document.body.search("some text")
     await context.sync();
    })
    
  3. Observe a SearchDialogIsOpen error

Context

The search(...) function is critical to our app. We use it to find and then track locations in the document, which we then annotate, suggest changes to, scroll to, etc.. Without it we have no way to get those locations.

As a result of this issue, we have to show an error message in our app when a user has the advanced search dialog open and we try to do almost anything. The user then has to close the search dialog in order to perform actions from our app.

I'm guessing the presence of a specific error for this case means it's a known issue on the OfficeJS side, but I'm opening this issue because search(...) is foundational to so many apps (I'm sure my use cases aren't unusual). Would it be possible to support API searches even when the advanced search dialog is open?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area: Word Issue related to Word add-ins label Sep 24, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Sep 24, 2024
Copy link
Contributor

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

@shanshanzheng-dev
Copy link
Contributor

Hi @greysteil Thanks for reporting this issue. I can repro it. We'll take a look and report back if we have a suggestion for you.

@wangyun-microsoft
Copy link

Hi @greysteil,

Is your use case that the end users need to keep both advanced search dialog and your search pane open at the same time?

@greysteil
Copy link
Author

greysteil commented Sep 26, 2024

The user has the advanced search dialog open for some reason that's unrelated to our add-in (it's just the way they're doing their work). I'd like to avoid having to ask them to close it, because I don't want our add-in to intrude on the way they're doing their other work.

Basically I want my add-in to be as un-intrusive as possible - it shouldn't make users take actions they don't want to / don't expect to have to take. The inability to use search(...) if the user has the advanced search dialog open is forcing me to ask the user to take an action that they wouldn't expect to have to take - to them, the fact my add-in uses search(...) to do its work, and that that's incompatible with the advanced search window being open, are implementation details they don't want to think about.

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 Needs: attention 👋 Waiting on Microsoft to provide feedback
Projects
None yet
Development

No branches or pull requests

5 participants