diff --git a/webpack/assets/javascripts/react_app/components/HostDetails/HostDetails.scss b/webpack/assets/javascripts/react_app/components/HostDetails/HostDetails.scss index f45514c7723..d5579d84f85 100644 --- a/webpack/assets/javascripts/react_app/components/HostDetails/HostDetails.scss +++ b/webpack/assets/javascripts/react_app/components/HostDetails/HostDetails.scss @@ -48,8 +48,16 @@ height: 100%; } } + .inline-edit-input-flex-item { + display: contents; + } + + .pf-c-inline-edit__value { + overflow-wrap: anywhere; + white-space: pre-line; + } } .host-details-tabs-section + .pf-c-tabs { - overflow: visible; + overflow: visible; } diff --git a/webpack/assets/javascripts/react_app/components/HostDetails/InlineEdit.js b/webpack/assets/javascripts/react_app/components/HostDetails/InlineEdit.js index 7eeff9e2ee9..6d8b8db4bb8 100644 --- a/webpack/assets/javascripts/react_app/components/HostDetails/InlineEdit.js +++ b/webpack/assets/javascripts/react_app/components/HostDetails/InlineEdit.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import PropTypes from 'prop-types'; -import { Button, TextInput, Flex, FlexItem } from '@patternfly/react-core'; +import { Button, TextArea, Flex, FlexItem } from '@patternfly/react-core'; import { PencilAltIcon, CheckIcon, TimesIcon } from '@patternfly/react-icons'; import { APIActions } from '../../redux/API'; @@ -9,10 +9,11 @@ import { sprintf, translate as __ } from '../../common/I18n'; export const InlineEdit = ({ name, - defaultValue, + defaultValue: _defaultValue, hostName, editPermission, }) => { + const [defaultValue, setDefault] = useState(_defaultValue); const [value, setValue] = useState(defaultValue); const [isEditing, setIsEditing] = useState(false); @@ -32,6 +33,7 @@ export const InlineEdit = ({ [name]: value, }, successToast: () => sprintf(__('%s saved'), name), + handleSuccess: () => setDefault(value), }) ); }; @@ -46,9 +48,9 @@ export const InlineEdit = ({ -