Skip to content

Commit 7a9de20

Browse files
authored
Merge pull request #72 from badasswp/fix/reset-replace-input-field
Fix: Reset `Replace` input field correctly
2 parents b515b77 + 7d18e6e commit 7a9de20

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.8.0
44
* Feat: Add Search & Replace feature for table head, foot & caption.
5+
* Fix: Reset replace input field.
56
* Tested up to WP 6.8.
67

78
## 1.7.0

src/core/app.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
4040
const [ caseSensitive, setCaseSensitive ] = useState< boolean >( false );
4141
const [ context, setContext ] = useState< boolean >( false );
4242

43-
// Reference to the first field inside the modal
43+
// Reference to the first field inside the modal.
4444
const searchFieldRef = useRef< HTMLInputElement | null >( null );
4545

4646
/**
@@ -58,10 +58,11 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
5858
.getSelection()
5959
.toString();
6060

61-
// By default, reset count and search input.
61+
// By default, reset count, search & replace inputs.
6262
if ( ! selectedText ) {
6363
setReplacements( 0 );
6464
setSearchInput( '' );
65+
setReplaceInput( '' );
6566
}
6667
};
6768

0 commit comments

Comments
 (0)