Upon opening the Window, the widget is not getting focused when using jQuery 3.6.0.
The Window is not focused upon opening.
The Window should be focused upon opening.
Hi,
The issue is still not resolved. There is a workaround for it by handling the activate Window event:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Window workaround</title>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.1.301/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.1.301/styles/kendo.default.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js"></script>
</head>
<body>
<div id="example">
<div id="window">
<p>Window content</p>
</div>
<button type="button" id="btn" class="btnClass">Click here to open the window.</button>
<div class="responsive-message"></div>
<script>
$(document).ready(function () {
var myWindow = $("#window"),
btn = $("#btn");
btn.click(function() {
myWindow.data("kendoWindow").center().open();
});
function onActivate(ev) {
ev.sender.wrapper[0].focus();
$(".responsive-message").text("activeElement: " + document.activeElement.className);
}
myWindow.kendoWindow({
title: "Window",
visible: false,
activate: onActivate
}).data("kendoWindow");
});
</script>
</div>
</body>
</html>
Regards,
Dimitar
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.