Skip to content

ui.search only matches the document body: text in headers, footers and footnotes is never found #4121

Open

Description

@eye-coding

What happened?

superdoc.ui.search.find() (the find/replace surface) returns matches from the body story only. Text that is painted on the page in a header, footer or footnote is never matched, so the find bar reports 0 results for words the reader can see.

Expected: matches in every visible story, as the reader sees them on the page, or at least an option to include headers, footers and notes.

Actual: only body matches are counted and navigated. SearchQueryOptions has caseSensitive, includeTrackedDeletions and regex, and no option for story scope.

Steps to reproduce

  1. Open the attached search-stories-repro.docx. It is one page of synthetic text. Each story holds a marker word that appears nowhere else:
    • body: alphabody
    • header: bravoheader
    • footer: charliefooter
    • footnote: deltafootnote
    • sharedmarker appears once in the body and once in the header
  2. Run superdoc.ui.search.find(word) for each word and read getSnapshot().total once it settles.
Query Where it is total
alphabody body 1
sharedmarker body + header 1
bravoheader header 0
charliefooter footer 0
deltafootnote footnote 0

All four marker words are present in the painted page's DOM.

Sample file: [attach search-stories-repro.docx]

SuperDoc version

superdoc 2.27.0; @superdoc/docx-engine 0.26.0

Browser

None

Additional context

No response

Investigation or proposed fix

No response

Activity

  1. ghost added theissue type on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: triageNew report awaiting initial assessment.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions