[openstreetmap/openstreetmap-website] make sure iD's iframe is focused on startup (PR #6083)

Marwin Hochfelsner notifications at github.com
Wed Jun 4 10:27:13 UTC 2025


@hlfan commented on this pull request.



> @@ -37,7 +37,8 @@ $(function () {
   id.attr("src", idData.url + "#" + params);
 
   id.ready(function () {
-    if (!this.contentWindow.location.href.startsWith(idData.url)) {
+    id.focus();
+    if (this.contentWindow && !this.contentWindow.location.href.startsWith(idData.url)) {

Wouldn't you also get the same real exception with the code as it is without touching it, now that you're not focusing iD with js?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6083#discussion_r2126259090
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6083/review/2896185445 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250604/7f872cfd/attachment.htm>


More information about the rails-dev mailing list