Closed georgejdli closed 2 months ago
very good
@georgejdli I would be interested in a PR in my fork for this feature. I can help get the SearchBar cleared as well.
GitHub: https://github.com/melloware/react-logviewer
Demo Site: https://melloware.github.io/react-logviewer/
I would like to be able to clear the current text from the display similar to you can clear the text from a terminal window by entering the "clear" command.
I played around with extended the LazyLog component in my project and added a "clearText" method that calls this.setState
To use this new method I would bind a ref (with useRef) to the LazyLogClear and call it elsewhere in my app. The only issue I've seen so far is that if I have a query in the SearchBar that query doesn't reset and when I clear the text from the display it ends up giving an inaccurate count of matched items (phantom resultLines from previously cleared text).
Are there any other state properties I'm missing or do I need to extend the SearchBar component as well so I can pass a prop to clear the search query?
Is there any interest in adding this feature directly to react-lazylog?