diff --git a/changelog/unreleased/issue-7396.toml b/changelog/unreleased/issue-7396.toml new file mode 100644 index 000000000000..c057db06b8bc --- /dev/null +++ b/changelog/unreleased/issue-7396.toml @@ -0,0 +1,5 @@ +type="c" +message="Always display input for widget title in widget edit mode." + +issues=["7396"] +pulls=["19737"] diff --git a/graylog2-web-interface/src/views/components/widgets/Widget.tsx b/graylog2-web-interface/src/views/components/widgets/Widget.tsx index 6d57c9f0013a..29fdfc74b25d 100644 --- a/graylog2-web-interface/src/views/components/widgets/Widget.tsx +++ b/graylog2-web-interface/src/views/components/widgets/Widget.tsx @@ -259,6 +259,7 @@ const Widget = ({ id, editing, widget, title, position, onPositionsChange }: Pro {!editing ? ( css` display: grid; grid-template-columns: minmax(35px, 1fr) max-content; align-items: center; + + .widget-title { + width: 100%; + max-width: 400px; + } `); const Col = styled.div` @@ -57,19 +63,48 @@ const WidgetActionDropdown = styled.span` position: relative; `; +const TitleInputWrapper = styled.div` + max-width: 400px; + width: 100%; + + .form-group { + margin-bottom: 5px; + width: 100%; + } +`; + +const TitleInput = styled(Input)(({ theme }) => css` + font-size: ${theme.fonts.size.large}; + width: 100%; +`); + type Props = { children: React.ReactNode, onRename: (newTitle: string) => unknown, hideDragHandle: boolean, title: string, loading: boolean, + editing: boolean, }; -const WidgetHeader = ({ children, onRename, hideDragHandle, title, loading }: Props) => ( +const WidgetHeader = ({ children, onRename, hideDragHandle, title, loading, editing }: Props) => ( {hideDragHandle || } - + {editing ? ( + + onRename(e.target.value)} + value={title} + required /> + + ) : ( + + )} {loading && }