Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/css/select-theme-chosen.sass
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ $mobileBreakPointSize: ($maxRows + 4) * $optionHeight
+inline-block
+user-select(none)
+no-mobile-tap-highlight
touch-action: manipulation;
border-radius: 5px
box-shadow: 0 0 3px #FFF inset, 0 1px 1px rgba(0, 0, 0, 0.1)
background-image: linear-gradient(to bottom, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%)
Expand Down
1 change: 1 addition & 0 deletions src/css/select-theme-dark.sass
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ $mobileBreakPointSize: ($maxRows + 4) * $optionHeight
+inline-block
+user-select(none)
+no-mobile-tap-highlight
touch-action: manipulation;
border-radius: .25em
position: relative
padding: $paddingTopBottom 3em $paddingTopBottom 1em
Expand Down
1 change: 1 addition & 0 deletions src/css/select-theme-default.sass
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ $mobileBreakPointSize: ($maxRows + 4) * $optionHeight
+inline-block
+user-select(none)
+no-mobile-tap-highlight
touch-action: manipulation;
border-radius: .25em
position: relative
padding: $paddingTopBottom 3em $paddingTopBottom 1em
Expand Down
7 changes: 2 additions & 5 deletions src/js/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const SPACE = 32;
const UP = 38;
const DOWN = 40;

const touchDevice = 'ontouchstart' in document.documentElement;
const clickEvent = touchDevice ? 'touchstart' : 'click';

function useNative() {
const {innerWidth, innerHeight} = window;
return touchDevice && (innerWidth <= 640 || innerHeight <= 640);
Expand Down Expand Up @@ -303,12 +300,12 @@ class Select extends Evented {
}

bindClick() {
this.target.addEventListener(clickEvent, (e) => {
this.target.addEventListener('click', (e) => {
e.preventDefault();
this.toggle();
});

document.addEventListener(clickEvent, (event) => {
document.addEventListener('click', (event) => {
if (!this.isOpen()) {
return;
}
Expand Down