Skip to content

Commit

Permalink
Small improvements to Dropdown(WithInput) UI components
Browse files Browse the repository at this point in the history
  • Loading branch information
SchoofsKelvin committed Feb 17, 2022
1 parent b477887 commit 9c83b07
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# Changelog

## Unreleased

### Changes
- Small improvements to Dropdown(WithInput) UI components

## v1.24.1 (2021-12-07)

### New features
Expand Down
2 changes: 1 addition & 1 deletion webview/src/FieldTypes/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class FieldDropdown<T> extends FieldBase<T, Props<T>, State> {
const { displayName } = this.props;
const display = newValue ? (displayName ? displayName(newValue) : `${newValue}`) : '';
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>
{open && this.generateDropdown()}
</div>;
Expand Down
2 changes: 1 addition & 1 deletion webview/src/FieldTypes/dropdownwithinput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FieldDropdownWithInput extends FieldBase<string | undefined, Props,
public renderInput() {
const { newValue, open } = this.state;
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} />
{open && this.generateDropdown()}
</div>;
Expand Down
12 changes: 8 additions & 4 deletions webview/src/FieldTypes/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

div.Field {
padding: 20px 9px 3px 9px;
}
Expand Down Expand Up @@ -50,6 +49,7 @@ div.FieldDropdown {
color: var(--vscode-settings-dropdownForeground);
border: 1px solid var(--vscode-settings-dropdownBorder);
position: relative;
cursor: pointer;
}

div.FieldDropdown > ul.list {
Expand All @@ -66,7 +66,8 @@ div.FieldDropdown > ul.list {
box-sizing: border-box;
}

div.FieldDropdown > .current, div.FieldDropdown ul.list > li {
div.FieldDropdown > .current,
div.FieldDropdown ul.list > li {
height: 1em;
padding: 5px;
list-style: none;
Expand Down Expand Up @@ -104,13 +105,16 @@ div.FieldDropdownWithInput ul.list {
top: 100%;
left: 0;
}

div.FieldDropdown p.arrow,
div.FieldDropdownWithInput p.arrow {
z-index: 999;
top: 0;
position: absolute;
padding: 5px;
right: 0;
margin: 0;
cursor: pointer;
}

div.FieldPath {
Expand Down Expand Up @@ -162,7 +166,7 @@ div.FieldCheckbox > .description {
margin-left: calc(var(--checkbox-size) + 10px);
}

.checkbox > .checkbox-box > .checkbox {
.checkbox > .checkbox-box > .checkbox {
float: left;
height: var(--checkbox-size);
width: var(--checkbox-size);
Expand All @@ -174,7 +178,7 @@ div.FieldCheckbox > .description {
}

.checkbox > .checkbox-box > .checkbox.checked::before {
content: '\2713';
content: "\2713";
display: block;
text-align: center;
}

0 comments on commit 9c83b07

Please sign in to comment.