Closed dweill closed 2 weeks ago
hi @dweill ,
Thank you for reporting the issue. I can't reproduce your case on word online. It all return rangeCollection no matter how many string hit. Like below picture. Could you please share more details about reproducing step or screen shot? Thanks.
Hmm strange, I can no longer reproduce it either. I originally noticed it because my code would error when invoking the getFirst method on the range search result, but that seems to be working now. Thank you for your prompt response and feedback.
@dweill , no problem, I will close this issue since you can't reproduce it any more.
Provide required information needed to triage your issue
When getting a document selection and performing a search
If there is only one instance of the search text in the document, Range.search returns a Range for the online version, but a RangeCollection for desktop. If there are multiple matches it correctly returns a RangeCollection, per the api documentation
Your Environment
Expected behavior
I would expect that calling the Range.search method returns a RangeCollection both online and on desktop versions of the office js api.
Current behavior
Currently, in the online version of the office js api, Range.search returns a RangeCollection OR a Range (if there is only one match)
An improvement would be for it to always return a RangeCollection or note the different behavior on the web in the documentation
Steps to reproduce
Link to live example(s)
Provide additional details
Context
Useful logs
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.