diff --git a/src/components/JsonEditor/JsonEditor.scss b/src/components/JsonEditor/JsonEditor.scss index cab49ea0df..df5f06835e 100644 --- a/src/components/JsonEditor/JsonEditor.scss +++ b/src/components/JsonEditor/JsonEditor.scss @@ -42,7 +42,7 @@ pointer-events: none; background: transparent; color: #555572; - overflow: auto; + overflow: hidden; code { display: block; @@ -90,7 +90,7 @@ .inputLayer { display: block; width: 100%; - min-width: 100%; + min-width: calc(var(--modal-min-width) * (1 - var(--modal-label-ratio))); background: transparent; color: transparent; caret-color: #333; diff --git a/src/components/MultiSelect/MultiSelect.react.js b/src/components/MultiSelect/MultiSelect.react.js index 532b853fd9..f742c6c6d2 100644 --- a/src/components/MultiSelect/MultiSelect.react.js +++ b/src/components/MultiSelect/MultiSelect.react.js @@ -81,7 +81,7 @@ export default class MultiSelect extends React.Component { render() { let popover = null; if (this.state.open) { - const width = this.dropdownRef.current.clientWidth; + const width = this.props.menuWidth || this.dropdownRef.current.clientWidth; const classes = [styles.menu]; if (this.props.dense) { diff --git a/src/dashboard/Data/Config/ConfigConflictDiff.scss b/src/dashboard/Data/Config/ConfigConflictDiff.scss index a3fa52cd2b..55c9259518 100644 --- a/src/dashboard/Data/Config/ConfigConflictDiff.scss +++ b/src/dashboard/Data/Config/ConfigConflictDiff.scss @@ -6,12 +6,13 @@ * the root directory of this source tree. */ .container { + contain: inline-size; width: 100%; - min-width: 100%; + min-width: 0; overflow: auto; - height: 200px; + height: 80px; min-height: 80px; - resize: both; + resize: vertical; text-align: left; } diff --git a/src/dashboard/Data/Config/ConfigDialog.react.js b/src/dashboard/Data/Config/ConfigDialog.react.js index 03c5327f09..7c2517c1d5 100644 --- a/src/dashboard/Data/Config/ConfigDialog.react.js +++ b/src/dashboard/Data/Config/ConfigDialog.react.js @@ -10,6 +10,7 @@ import Dropdown from 'components/Dropdown/Dropdown.react'; import Field from 'components/Field/Field.react'; import FileInput from 'components/FileInput/FileInput.react'; import GeoPointInput from 'components/GeoPointInput/GeoPointInput.react'; +import Icon from 'components/Icon/Icon.react'; import Label from 'components/Label/Label.react'; import Modal from 'components/Modal/Modal.react'; import NonPrintableHighlighter, { hasNonPrintableChars, getNonPrintableCharsFromJson, hasNonAlphanumericChars, getNonAlphanumericCharsFromJson, getRegexValidation, getRegexValidationFromJson } from 'components/NonPrintableHighlighter/NonPrintableHighlighter.react'; @@ -18,6 +19,8 @@ import Parse from 'parse'; import React from 'react'; import TextInput from 'components/TextInput/TextInput.react'; import Toggle from 'components/Toggle/Toggle.react'; +import Popover from 'components/Popover/Popover.react'; +import Position from 'lib/Position'; import Button from 'components/Button/Button.react'; import JsonEditor from 'components/JsonEditor/JsonEditor.react'; import validateNumeric from 'lib/validateNumeric'; @@ -120,6 +123,7 @@ export default class ConfigDialog extends React.Component { constructor(props) { super(); + this.optionsRef = React.createRef(); this.state = { value: null, type: 'String', @@ -129,6 +133,7 @@ export default class ConfigDialog extends React.Component { wordWrap: false, showDiff: false, confirmOverride: false, + optionsMenuOpen: false, error: null, syntaxColors: null, }; @@ -335,6 +340,14 @@ export default class ConfigDialog extends React.Component { }); } + updateOptionsMenuPos = () => { + if (this.optionsRef.current) { + const pos = Position.inWindow(this.optionsRef.current); + pos.y -= 4; + this.setState({ optionsMenuPos: pos }); + } + }; + formatValue() { const { value, error } = ConfigDialog.formatJSON(this.state.value); this.setState({ value, error }); @@ -566,37 +579,58 @@ export default class ConfigDialog extends React.Component { onClick={this.compactValue.bind(this)} disabled={!this.canFormatValue()} /> - {this.state.error && ( {this.state.error} )} )} - {isDiffableType && isExistingParam && ( -