I've attempted using blur()
to change the CSS, but it seems that this function is not effective. After researching, I discovered that blur()
does not work on IOS devices. Is there an alternative method for removing the position
from .body-clip-overflow
when focus leaves an input field? Attached below is my code. Link
$(document).on('focus', 'input, textarea', function() {
$('.body-clip-overflow').css('position', 'fixed');
$('.ui-dialog').css('position', 'absolute');
$('.ui-dialog').css('top', '80px');
});
$(document).on('blur', 'input, textarea', function() {
setTimeout(function() {
$('.body-clip-overflow').css('position', 'relative');
}, 100);
});