josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

Implement search in text mode when read only #251

Closed crystalrain125 closed 1 year ago

crystalrain125 commented 1 year ago

Could we provide search functionality to text mode when in read-only mode? It's currently supported in tree mode.

Screenshot 2023-04-05 at 4 49 18 PM
josdejong commented 1 year ago

Good idea, thanks for your suggestion!

Anyone interested in implementing support for search (not replace) in text mode when read only?

laneparton commented 1 year ago

@josdejong This is something I'm interested in for our application. I was experimenting a little bit with the repo - this is my first time actually looking at the underlying package, codemirror.

I'm sure you've got plenty of experience with codemirror 😄, do you think we could achieve this with the editable + readOnly options?

I see the comments from this PR: https://github.com/josdejong/svelte-jsoneditor/pull/130

Maybe we need to specifically handle mobile, but open up editable as an option? What are your thoughts or how would you advise moving forward?

josdejong commented 1 year ago

Thanks for your offer Lane.

I looked into it, and it was mainly caused by #142. I fixed #142 now and made sure the search button is displayed in readOnly mode (https://github.com/josdejong/svelte-jsoneditor/commit/50f8889597466ec8027c07dda3d4e613684aa9dc).