2015-01-24 11 views
5

पर jQuery UI स्वत: पूर्ण combobox खोलता है मैं jQuery UI स्वत: पूर्ण combobox विजेट का उपयोग कर रहा हूँ। जब मैं अपने comboboxes पर प्लेसहोल्डर जोड़ता हूं, तो स्वत: पूर्ण बॉक्स डिफ़ॉल्ट रूप से खोले जाते हैं।प्लेसहोल्डर पृष्ठ लोड (IE10)

यह केवल होता है केवल IE10 और बाद में पर होता है।

_create: function() { 
      this.wrapper = $("<span>") 
      .addClass("custom-combobox") 
      .insertAfter(this.element); 
      this.element.hide(); 
      this._createAutocomplete(); 
      this._createShowAllButton(); 
      this.input.attr("placeholder", this.element.attr('placeholder')); 
     }, 
+1

कृपया समस्या के बारे में कुछ और विवरण लिखें। –

उत्तर

6

हमने देखा है कि इस मुद्दे को वास्तव में comboboxes ध्यान केंद्रित करके हल किया जा रहा था:

यह मेरा कोड है।

एक बार कम्बोबॉक्स केंद्रित हो जाने पर, स्वत: पूर्ण बॉक्स गायब हो गया और यह तब तक बना रहा जब कंबोबॉक्स फोकस खो गया।

तो, हमारे समाधान एक सा हैक-ish, हम एक .focus() एक .blur() के बाद जोड़ा गया था:

_create: function() { 
      this.wrapper = $("<span>") 
      .addClass("custom-combobox") 
      .insertAfter(this.element); 
      this.element.hide(); 
      this._createAutocomplete(); 
      this._createShowAllButton(); 
      this.input.attr("placeholder", this.element.attr('placeholder')); 

      this.input.focus().blur(); 
      //^^^^^^^^^^^^^^^^^^^^^^^^^^ Voila! 
     }, 
0

हम IE10 + में एक ही समस्या थी लेकिन सिर्फ हम विशेष के साथ एक प्लेसहोल्डर जोड़ने जब पात्र (जर्मन "उमलाइट")।

Seckin द्वारा समाधान भी हमारी समस्या हल - कठिन गूगल काम ;-)

जवाब- लिए वोट करने की कोशिश की के 1 दिन के बाद लेकिन एक नौसिखिया के रूप में मैं ऐसा करने के लिए नहीं प्रतिष्ठा है। ..

_create: function() { 
     this.wrapper = $("<span>") 
     .addClass("custom-combobox") 
     .insertAfter(this.element); 
     this.element.hide(); 
     this._createAutocomplete(); 
     this._createShowAllButton(); 

     this.input.attr("placeholder", 'Bitte wählen'); 
     this.input.focus().blur(); 

    }, 
+0

मुझे खुशी है कि इससे मदद मिली! क्रेडिट @oekokroete के लिए धन्यवाद, हालांकि यह एक ही समाधान है; मुझे नहीं लगता कि यह एक जवाब होना चाहिए, मौजूदा जवाब पर टिप्पणी के रूप में इसे जोड़ने के लिए आपका स्वागत है। –