Small improvements to Dropdown(WithInput) UI components

pull/373/head
Kelvin Schoofs 3 years ago
parent b4778878fa
commit 9c83b07e8d

@ -1,6 +1,11 @@
# Changelog # Changelog
## Unreleased
### Changes
- Small improvements to Dropdown(WithInput) UI components
## v1.24.1 (2021-12-07) ## v1.24.1 (2021-12-07)
### New features ### New features

@ -25,7 +25,7 @@ export class FieldDropdown<T> extends FieldBase<T, Props<T>, State> {
const { displayName } = this.props; const { displayName } = this.props;
const display = newValue ? (displayName ? displayName(newValue) : `${newValue}`) : ''; const display = newValue ? (displayName ? displayName(newValue) : `${newValue}`) : '';
return <div className="FieldDropdown" ref={this.mainDivRef}> return <div className="FieldDropdown" ref={this.mainDivRef}>
<p style={{ float: 'right', margin: 5 }}></p> <p className="arrow" onClick={this.toggle}></p>
<div className="current" onClick={this.toggle}>{display}</div> <div className="current" onClick={this.toggle}>{display}</div>
{open && this.generateDropdown()} {open && this.generateDropdown()}
</div>; </div>;

@ -23,7 +23,7 @@ export class FieldDropdownWithInput extends FieldBase<string | undefined, Props,
public renderInput() { public renderInput() {
const { newValue, open } = this.state; const { newValue, open } = this.state;
return <div className="FieldDropdown FieldDropdownWithInput" ref={this.mainDivRef}> return <div className="FieldDropdown FieldDropdownWithInput" ref={this.mainDivRef}>
<p className="arrow"></p> <p className="arrow" onClick={this.toggle}></p>
<input className="current" value={newValue || ''} onChange={this.onChangeEvent} onClick={this.toggle} /> <input className="current" value={newValue || ''} onChange={this.onChangeEvent} onClick={this.toggle} />
{open && this.generateDropdown()} {open && this.generateDropdown()}
</div>; </div>;

@ -1,4 +1,3 @@
div.Field { div.Field {
padding: 20px 9px 3px 9px; padding: 20px 9px 3px 9px;
} }
@ -50,6 +49,7 @@ div.FieldDropdown {
color: var(--vscode-settings-dropdownForeground); color: var(--vscode-settings-dropdownForeground);
border: 1px solid var(--vscode-settings-dropdownBorder); border: 1px solid var(--vscode-settings-dropdownBorder);
position: relative; position: relative;
cursor: pointer;
} }
div.FieldDropdown > ul.list { div.FieldDropdown > ul.list {
@ -66,7 +66,8 @@ div.FieldDropdown > ul.list {
box-sizing: border-box; box-sizing: border-box;
} }
div.FieldDropdown > .current, div.FieldDropdown ul.list > li { div.FieldDropdown > .current,
div.FieldDropdown ul.list > li {
height: 1em; height: 1em;
padding: 5px; padding: 5px;
list-style: none; list-style: none;
@ -104,6 +105,8 @@ div.FieldDropdownWithInput ul.list {
top: 100%; top: 100%;
left: 0; left: 0;
} }
div.FieldDropdown p.arrow,
div.FieldDropdownWithInput p.arrow { div.FieldDropdownWithInput p.arrow {
z-index: 999; z-index: 999;
top: 0; top: 0;
@ -111,6 +114,7 @@ div.FieldDropdownWithInput p.arrow {
padding: 5px; padding: 5px;
right: 0; right: 0;
margin: 0; margin: 0;
cursor: pointer;
} }
div.FieldPath { div.FieldPath {
@ -162,7 +166,7 @@ div.FieldCheckbox > .description {
margin-left: calc(var(--checkbox-size) + 10px); margin-left: calc(var(--checkbox-size) + 10px);
} }
.checkbox > .checkbox-box > .checkbox { .checkbox > .checkbox-box > .checkbox {
float: left; float: left;
height: var(--checkbox-size); height: var(--checkbox-size);
width: var(--checkbox-size); width: var(--checkbox-size);
@ -174,7 +178,7 @@ div.FieldCheckbox > .description {
} }
.checkbox > .checkbox-box > .checkbox.checked::before { .checkbox > .checkbox-box > .checkbox.checked::before {
content: '\2713'; content: "\2713";
display: block; display: block;
text-align: center; text-align: center;
} }

Loading…
Cancel
Save