diff --git a/src/cg-select.js b/src/cg-select.js index f1ffe59..9df2170 100644 --- a/src/cg-select.js +++ b/src/cg-select.js @@ -396,7 +396,7 @@ export class DropDown { * @description Рендер елементов в селекте. */ #render(select) { - const { styles, multiselect, searchMode, multiselectTag, darkTheme, language } = this.#options; + const { styles, multiselect, searchMode, multiselectTag, darkTheme, language, nativeSelectMode } = this.#options; const random = Math.random().toString(36).substring(2, 10); if (select || (select && styles)) { @@ -483,6 +483,10 @@ export class DropDown { this.#checkTheme(); } + if(nativeSelectMode === true){ + this.#SelectMode(nativeSelectMode); + } + this.#list = this.#element.querySelector('.list'); this.#caret = this.#element.querySelector('.caret'); @@ -835,4 +839,35 @@ export class DropDown { } }); } + + /** + * Приватный метод экземпляра класса DropDown + * @protected + * @param {boolean} nativeSelectMode + * @description Изменяет отображение селекта на мобильных устройствах + * @method #SelectMode + */ + #SelectMode(nativeSelectMode){ + let win = window.outerWidth; + + if(nativeSelectMode === true){ + const select = this.#element.querySelector('.cg-select'); + const list = this.#element.querySelector('.list'); + const nativeSelect = this.#element.querySelector('.nativeSelect'); + + + // if(win < 576){ + + + // } else if( win > 576){ + // select.classList.remove('displayHide'); + // list.classList.remove('displayHide'); + // nativeSelect.classList.remove('nativeSelectActive'); + // nativeSelect.classList.add('displayHide'); + // } + } else{ + return + } + + } } diff --git a/src/main.scss b/src/main.scss index 5ff4e87..5d0f998 100644 --- a/src/main.scss +++ b/src/main.scss @@ -258,8 +258,11 @@ input[type='checkbox'] { .label { color: white; } + //-------Behavior-------- + .active { + text-align: start; background: #8282822c; } @@ -270,7 +273,7 @@ input[type='checkbox'] { -ms-transition: 0.5s; -o-transition: 0.5s; - display: block; + display: block !important; opacity: 1; &_none { @@ -289,7 +292,7 @@ input[type='checkbox'] { } .displayHide { - display: none; + display: none !important; } /*320px - 576px*/ diff --git a/src/page/index.html b/src/page/index.html index fe5a440..a294766 100644 --- a/src/page/index.html +++ b/src/page/index.html @@ -4,6 +4,15 @@ + + + + + +