diff --git a/stroom-app/src/main/resources/ui/css/components.css b/stroom-app/src/main/resources/ui/css/components.css index 2db75b5571..9c397585ca 100644 --- a/stroom-app/src/main/resources/ui/css/components.css +++ b/stroom-app/src/main/resources/ui/css/components.css @@ -2069,6 +2069,11 @@ button.main-menu svg { height: 2.1rem; } +.find-topBar .gwt-TextArea.multiLine { + /* Multi line */ + height: 6.3rem; +} + .find-buttons { display: flex; position: absolute; diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/view/FindInContentViewImpl.java b/stroom-core-client/src/main/java/stroom/explorer/client/view/FindInContentViewImpl.java index 05d531191f..1af6ca8e58 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/view/FindInContentViewImpl.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/view/FindInContentViewImpl.java @@ -26,6 +26,7 @@ import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; @@ -99,13 +100,24 @@ public void focus() { } @UiHandler("pattern") - void onPatternChange(final KeyUpEvent e) { + void onPatternKeyUp(final KeyUpEvent e) { getUiHandlers().changePattern(pattern.getText(), toggleMatchCase.getState(), toggleRegex.getState()); } @UiHandler("pattern") - void onPatternKeyDown(final KeyDownEvent event) { - getUiHandlers().onPatternKeyDown(event); + void onPatternKeyDown(final KeyDownEvent e) { + if (!e.getNativeEvent().getShiftKey()) { + getUiHandlers().onPatternKeyDown(e); + } + } + + @UiHandler("pattern") + void onPatternChange(final ValueChangeEvent e) { + if (pattern.getText().contains("\n")) { + pattern.getElement().addClassName("multiLine"); + } else { + pattern.getElement().removeClassName("multiLine"); + } } @UiHandler("toggleMatchCase") diff --git a/unreleased_changes/20250131_161637_158__4734.md b/unreleased_changes/20250131_161637_158__4734.md new file mode 100644 index 0000000000..e340aef17e --- /dev/null +++ b/unreleased_changes/20250131_161637_158__4734.md @@ -0,0 +1,24 @@ +* Issue **#4734** : Fix find in content multi line query behaviour. + + +```sh +# ******************************************************************************** +# Issue title: Find In Content, can press return in search string, behaviour is a bit odd. +# Issue link: https://github.com/gchq/stroom/issues/4734 +# ******************************************************************************** + +# ONLY the top line will be included as a change entry in the CHANGELOG. +# The entry should be in GitHub flavour markdown and should be written on a SINGLE +# line with no hard breaks. You can have multiple change files for a single GitHub issue. +# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than +# 'Fixed nasty bug'. +# +# Examples of acceptable entries are: +# +# +# * Issue **123** : Fix bug with an associated GitHub issue in this repository +# +# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository +# +# * Fix bug with no associated GitHub issue. +```