FIX: Need to double click on get focus in order to open the select list
Opened this issue · 1 comments
Asscobara commented
app.directive
(
'nyaFix',
[
'$timeout',
function ($timeout)
{
return function (scope, element, attrs)
{
var timeFromLostFocus = new Date();
$( "#" + element[0].id ).focusin
(
function()
{
$timeout
(
function()
{
var currectTime = new Date();
if( currectTime.getTime() - timeFromLostFocus.getTime() > 150)
$( "#" + element[0].id ).addClass('open');
},
100
);
}
);
$( "#" + element[0].id ).focusout
(
function()
{
timeFromLostFocus = new Date();
}
);
scope.$watch
(
attrs.ngModel,
function()
{
$timeout
(
function()
{
$( "#" + attrs.nyaFixSetFocusId ).focus();
},
250
);
}
);
};
}
]
);
Asscobara commented
Use in the HTML
- {{option.displayName}}