Skip to content

Commit ba6cd71

Browse files
committed
Fix TextInputGroup
1 parent 112189d commit ba6cd71

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
- Add `TreeViewItem.disabled(boolean)`
1212
- Add `Variable.utilVar(String, String...)`
1313
- Add `HasItems.items()`
14+
- Add `TextInputGroup.onChange(ChangeHandler<TextInputGroup, String> changeHandler)`
1415

1516
### Changed
1617

components/src/main/java/org/patternfly/component/textinputgroup/TextInputGroup.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.patternfly.component.chip.Chip;
2424
import org.patternfly.component.chip.ChipGroup;
2525
import org.patternfly.core.ObservableValue;
26+
import org.patternfly.handler.ChangeHandler;
2627
import org.patternfly.handler.CloseHandler;
2728
import org.patternfly.style.Modifiers.Disabled;
2829

@@ -75,11 +76,7 @@ public static TextInputGroup searchInputGroup(String placeholder) {
7576
textEntered.change(false);
7677
})));
7778

78-
textEntered.subscribe((current, previous) -> {
79-
if (current) {
80-
setVisible(textInputGroup.utilities(), true);
81-
}
82-
});
79+
textEntered.subscribe((current, previous) -> setVisible(textInputGroup.utilities(), current));
8380
textEntered.publish();
8481

8582
return textInputGroup;
@@ -198,6 +195,14 @@ public TextInputGroup that() {
198195
return this;
199196
}
200197

198+
// ------------------------------------------------------ events
199+
200+
/** Delegates to {@link TextInputGroupMain#onChange(ChangeHandler)} */
201+
public TextInputGroup onChange(ChangeHandler<TextInputGroup, String> changeHandler) {
202+
main.onChange(changeHandler);
203+
return this;
204+
}
205+
201206
// ------------------------------------------------------ api
202207

203208
@SuppressWarnings("ConfusingMainMethod")

0 commit comments

Comments
 (0)