Skip to content

Commit

Permalink
Fix select dropdown position when helper text is present
Browse files Browse the repository at this point in the history
  • Loading branch information
julkue committed Oct 25, 2019
1 parent aeebe75 commit 4c76425
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@julmot/form-components",
"version": "1.0.1",
"version": "1.0.2",
"description": "Custom Form Components. Without Any Framework. Accessible.",
"keywords": [
"form",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Select extends FormComponent {
super.init();

this.wrapper = context.querySelector('.select__wrapper');
this.error = context.querySelector('.select__error');
this.helperField = context.querySelector('.select__helper');
this.dropdown = null;
this.dropdownOptions = [];
this.userInfo = Bowser.parse(window.navigator.userAgent);
Expand All @@ -37,10 +37,12 @@ export class Select extends FormComponent {
this.dropdown.appendChild(option);
return option;
});
if (!this.error) {
this.context.appendChild(this.dropdown);
if (this.helperField) {
this.context.insertBefore(this.dropdown, this.helperField);
} else if (this.errorField) {
this.context.insertBefore(this.dropdown, this.errorField);
} else {
this.context.insertBefore(this.dropdown, this.error);
this.context.appendChild(this.dropdown);
}
}

Expand Down
Binary file modified src/fonts/form-components-icons/form-components-icons.woff
Binary file not shown.

0 comments on commit 4c76425

Please sign in to comment.