Skip to content

Commit 852420b

Browse files
author
wassx
committed
Improving api for resetting a textbox
1 parent 58924bb commit 852420b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/gwt/material/design/client/ui/MaterialTextBox.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ public void setValid() {
9191
txtBox.getElement().addClassName("valid");
9292
isValid = true;
9393
}
94+
95+
/**
96+
* Resets the textbox by removing its content and resetting visual state.
97+
*/
98+
public void clear() {
99+
txtBox.setText("");
100+
backToDefault();
101+
}
94102

95103
public void backToDefault() {
96104
txtBox.getElement().removeClassName("valid");

0 commit comments

Comments
 (0)