iPad๋ฅผ ํตํด https://harvesthq.github.io/chosen/์ ์ก์ธ์คํฉ๋๋ค. Chrome ์ฝ์์ "Toggle device toolbar"๋ฅผ ํตํด ์ฌํํ ๋ค์ "iPad" ์ฅ์น๋ฅผ ์ ํํด๋ ๋ฉ๋๋ค.
"๋ค์ค ์ ํ"์์ ์์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
์ด์ ๋ค๋ฅธ ๊ณณ์ ํด๋ฆญํ์ง ์๊ณ "x"๋ฅผ ํด๋ฆญํ์ฌ ์ถ๊ฐ๋ ์์๋ฅผ ์ ๊ฑฐํฉ๋๋ค. ์๋ฌด ๋ฐ์์ด ์์ต๋๋ค.
li.search-choice
์์๋ฅผ ์ ๊ฑฐํด์ผ ํฉ๋๋ค. select.chosen-select option
๋ ์ ํ์ ์ทจ์ํด์ผ ํฉ๋๋ค.
li.search-choice
์์๊ฐ ์ ์ง๋ฉ๋๋ค. select.chosen-select option
๋ ๊ณ์ ์ ํ๋ฉ๋๋ค. chosen.click
์ด๋ฒคํธ๋ ๋ฐ์ํ์ง ์์ต๋๋ค.
์ ํ๋ ๋ฒ์ : 1.8.7(์ ํ๋ ์น์ฌ์ดํธ์์) ๋ฐ ~1
jQuery ๋๋ ํ๋กํ ํ์ ๋ฒ์ : 3.2.1(์ ํ๋ ์น์ฌ์ดํธ) ๋ฐ 2.1.4 ๋ฐ 2.2.4
๋ธ๋ผ์ฐ์ ๋ฐ ๋ฒ์ : Chrome, ๋ฒ์ 70.0.3538.110(๊ณต์ ๋น๋)(64๋นํธ)
OS ๋ฐ ๋ฒ์ : Windows 10, ๋ฒ์ 1709, OS ๋น๋ 16299.492
๋ธ๋ผ์ฐ์ ์์ ์๋ํ์ง๋ง(์ฝ์์ "์ฅ์น ๋๊ตฌ ๋ชจ์ ์ ํ"์ ํตํด) ๊ฐ์ฅ ์ง๊ด์ ์ด์ง ์์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
li.search-choice
์์๊ฐ ์ถ๊ฐ๋๋๋ก ํผ์ณ์ง๋ ๋ฉ๋ด์์ ์์๋ฅผ ์ ํํฉ๋๋ค. ์ฐธ๊ณ : "x"๋ฅผ ํด๋ฆญํด๋ ์๋ฌด ์์
๋ ์ํ๋์ง ์์ต๋๋ค.์ค์ ๋ฌผ๋ฆฌ์ iPad์์๋ ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์์๊ฐ ์ถ๊ฐ๋๋ฉด ํด๋ฆญ์กฐ์ฐจ ์ ์๊ฐ์ ์ด๊ธฐํ๋์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ ํํ ์๋ฐ์คํฌ๋ฆฝํธ ์ฝ๋๋ฅผ ๋น ๋ฅด๊ฒ ์ค์บํ๋ฉด ํด๋ฆญ๊ณผ ๊ด๋ จํ์ฌ ๋ค์๊ณผ ๊ฐ์ ํต์ฌ ์ด๋ฒคํธ๊ฐ ์ฒ๋ฆฌ๋๊ณ ์์์ ์ ์ ์์ต๋๋ค.
mousedown
mousemove
mouseup
touchstart
touchmove
touchend
๋ด๊ฐ ๋ณด์ง ๋ชปํ๋ ๊ฒ์ ๋ค์์ ๋ํ ์ด๋ฒคํธ ์ฒ๋ฆฌ์ ๋๋ค.
pointerdown
pointermove
pointerup
์๋ง๋ ์ด๊ฒ์ด ๋ฌธ์ ์ ์ํฅ์ ๋ฏธ์ณค์ต๋๊น?
(์ ์ด๋ iPad๋ก ๊ฐ์ฅํ๋ Chrome์์๋) ๋ค์ค ์ ํ์์ ํญ๋ชฉ์ ์ ํ ์ทจ์ํ ์ ์์์ ํ์ธํ ์ ์์ต๋๋ค. X๋ฅผ ๋๋ฌ๋ ์๋ฌด ์์ ๋ ์ํ๋์ง ์์ต๋๋ค.
๋๋ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฒช์๋ค.
์ ํ ํ๋(๋ซ๋ ํ๋๋ฟ๋ง ์๋๋ผ ์ค์ ๋ก ๋ค๋ฅธ ์์์ ์ด์ )์์ ์ด์ ์ ๋ง์ถ๋ฉด X ๋ฒํผ์ด ์ฌ์ ํ ์๋ํ์ง ์๋๋ค๋ ๊ฒ์ ์์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ด ํ๋์ ๋ค์ ์ด์ ์ ๋ง์ถ๊ณ ๋๋กญ๋ค์ด์ ํ์ํ๋ฏ๋ก ์ด์ ์ต์ ์ ์ฑ๊ณต์ ์ผ๋ก ์ญ์ ํ ์ ์์ต๋๋ค.
๋๋กญ๋ค์ด์ ๋ซ์ผ๋ฉด ๋ค์ X๊ฐ ์๋ํ์ง ์์ต๋๋ค.
ํฌ๋กฌ ์๋ฎฌ๋ ์ดํฐ์ ๋ฌผ๋ฆฌ์ ์ฅ์น ๋ชจ๋์์ ์ด๊ฒ์ ์ฌํํ ์ ์์ต๋๋ค.
๋ช
ํํ ํ๊ธฐ ์ํด์์
๋๋ค. ์์์์ ๋๊ฐ๋ฉด chosen-container-active
ํด๋์ค๋ฅผ ์ญ์ ํ๋ ค๋ฉด .chosen-container
๋ฅผ ๋ง๋ค์ด์ผ ํฉ๋๋ค. ๋ chosen-container-active
์์ ์ ๊ฑฐ chosen-container
์๋ก์ด ์ด์ ์ ๋ค์ ์ ์ฉ,์ด ์๊ฐ์ ์ ์๋ํฉ๋๋ค.
์, ์ฌ๊ธฐ์ ๋ฌธ์ ๊ฐ ์ ํํ ๋ฌด์์ธ์ง ์ ๋ชจ๋ฅด๊ฒ ์ง๋ง ์ ์๊ฒ ๋์์ด ๋์์ต๋๋ค.
๋จผ์ ์ด๊ธฐํํ ๋ ๋ค์ ์ต์ ์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
el.chosen({
display_selected_options: false,
hide_results_on_select: false,
});
์ ํํ ๋ช ๊ฐ์ง ์ด์ ๋ก ํ๋์ ์ง์คํ์ง ์์ ๋ ์ปจํธ๋กค๊ณผ์ ์ํธ ์์ฉ์ ์ฐจ๋จํฉ๋๋ค.
์ธ๋ถ ํ๋๋ฅผ ํด๋ฆญํ๋ฉด results_hide
๊ฐ ํธ์ถ๋๊ณ ์ด ๋ฉ์๋๋ ํ๋ ์ก์ธ์ค๋ฅผ ์์ ํ ์ฐจ๋จํฉ๋๋ค(์ ์ด๋ ๋ชจ๋ฐ์ผ/ํ๋ธ๋ฆฟ์์). ๊ทธ๋์ ์ด ํ๋์ ๋ฐฉ์งํ ๋ฐฉ๋ฒ์ ์ฐพ๊ณ ์์์ต๋๋ค.
results_showing
ํ๋๊ทธ๋ฅผ false๋ก ์ค์ ํ๋ฉด ์ด ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
Chosen.prototype.results_hide = function() {
if (this.results_showing) {
this.result_clear_highlight();
this.container.removeClass("chosen-with-drop");
this.form_field_jq.trigger("chosen:hiding_dropdown", {
chosen: this
});
}
// removed because of mobile issue with removeing options
// return this.results_showing = false;
};
์์ค์์ ์ ๊ฑฐํ๋ฉด(๋ถํธํ์ง๋ง ์ง๊ธ์ ๋ค๋ฅธ ์ ํ์ด ์์) ํธ๋ฆญ์ ์ํํด์ผ ํฉ๋๋ค.
์ด๊ฒ์ด ์ค์ ๋ก ๋ฌด์์ ํ๋์ง๋ ๋ชจ๋ฅด๊ฒ ์ง๋ง ํ์ฌ๋ก์๋ ์ด๋ค ๋ถ์์ฉ๋ ๋๋ผ์ง ๋ชปํ์ต๋๋ค.
๋ฐฉ๊ธ ๋ชจ๋ ๋ชจ๋ฐ์ผ ์ฅ์น ๋ฐ ํ๋ธ๋ฆฟ์ ๋ํด ์ ํ์ ๋นํ์ฑํํ์ต๋๋ค. ๋ด์ฅ ํฐ์น ์ ํ ์ธํฐํ์ด์ค๊ฐ ์ ํํ ์ ๋ ฅ ์์๋ณด๋ค ์ฌ์ฉ์ ์นํ์ ์ธ์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๊ฒ์ ์ต์ ์ด ๋๋ฝ๋์์ง๋ง ํฐ์น ์ฅ์น์์๋ ์ด์จ๋ ์ด์ํ๊ฒ ๋๊ปด์ก์ต๋๋ค.
590ํ:
AbstractChosen.browser_is_supported = function() {
if ("Microsoft Internet Explorer" === window.navigator.appName) {
return document.documentMode >= 8;
}
if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
return false;
}
if ((/iPhone|iPod|iPad|Android|android|playbook|silk|BlackBerry/).test(navigator.userAgent))
{
return false;
}
if (/Android/i.test(window.navigator.userAgent)) {
if (/Mobile/i.test(window.navigator.userAgent)) {
return false;
}
}
return true;
};
๊ฑด๋ฐฐ
ํ๋ค์ค