Can't type in Select2 dropdown input search field
See original GitHub issueCan’t type in Select2 dropdown input search field.
I have found many issues listed which mentions the same problem but nothing worked for me (https://www.google.com/search?q=can’t+type+in+select2&ie=utf-8&oe=utf-8&client=firefox-b-ab). I can’t type in Select2 dropdown input search field in model dialog using jQuery. By the way i can select value fine from dropdown. Tried inserting tabindex: 0 but no luck.
$.ajax({
type: "POST",
url: "<?php echo $myScripts; ?>",
data: { id1: "get-release-dropdown-html", id100: "<?php echo $dbTable; ?>" },
success:function(releaseDropdown){
$('#progress').hide();
$( "#modelDialog1" ).dialog({
modal: true,
width: '570',
height: '600',
resizable: true,
position:
{
my: "center",
at: "center",
of: window,
},
title: "Trigger Build",
open: function() {
$(this).html("<br/>Please select job options.<br/><br/><br/><b>Release:</b>" + releaseDropdown + "<div style='margin-top:30px;'/><b>Build Release Candidate:</b><select id='sReleaseCandidate'><option value='ga' selected>GA</option><option value='beta1'>BETAX</option>'></br>");
$("#sDescription").focus();
$("#sRelease, #sReleaseCandidate").select2({
tags: true
});
},
close: function() {
$( this ).dialog( "close" );
},
});
}
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:18 (3 by maintainers)
Top Results From Across the Web
Code - Stack Overflow
I can't type in Select2 dropdown input search field in model dialog using jQuery. By the way i can select value fine from...
Read more >Common problems - The jQuery replacement for select boxes
Select2 does not function properly when I use it inside a Bootstrap modal. This issue occurs because Bootstrap modals tend to steal focus...
Read more >Sign in - YouTube
jQuery : Can't type in Select2 dropdown input search field (http://kevin-brown.com/select2/). 38 views ...
Read more >How to get Select2 searchable dropdown to work inside a modal
I need a searchable dropdown inside my modal. ... </select>. This adds a second search box underneath, but you can't type in it....
Read more >Select 2 drop-down input search doesn't work inside bootstrap ...
By removing the " tabindex " attribute from the modal. This will allow moving around in the Select2 box, but you lose the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is the problem releated to #4871?
You could try to define the parameter “DropdownParent” of the select2 element. The name given to the parameter is the name of the modal form where the select2 is placed on. Here below an example of how to use this parameter.
remove “tabindex” attribute from modal