# BUG: Opening the switch node has strange behavior

**URL:** <https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320>\
**Category:** Core Development\
**Tags:** editor, switch-node\
**Created:** [30 November 2023 20:07 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320 "2023-11-30T20:07:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [30 November 2023 20:07 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/1 "2023-11-30T20:07:50Z")

</div>

When I open the switch node I have strange behavior:

![Enregistrement-de-l’écran-2023-11-30-à-20.57.48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/96b65a2ca5c347c106d8da5aebc2f308b6d1655a.gif)

Works on Chrome but not on Safari (v17.1)  
Node-RED v3.1.1

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 November 2023 20:12 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/2 "2023-11-30T20:12:58Z")

</div>

This happens to me - but I wouldn't call it a bug (more the window going crazy for a few s) - as its not causing any problems (at least for me), maybe a quirk with Safari

and I'm using 3.1.0.

**EDIT**  
wait - is it closing also?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 November 2023 20:16 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/3 "2023-11-30T20:16:42Z")

</div>

Out of interest, if you fully refresh and the first thing you do is open the change node, does it still happen?

Ps: [Safari is the new...](https://www.google.com/search?hl=en-GB&ram_mb=11597&aos=9&ampcct=6045&lns_as=1&qsubts=1701375318489&cs=1&q=safari%20is%20the%20new%20ie)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 November 2023 20:17 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/4 "2023-11-30T20:17:28Z")

</div>

> [@Steve-Mcl](#):
>
> Ps: [Safari is the new...](https://www.google.com/search?hl=en-GB&ram_mb=11597&aos=9&ampcct=6045&lns_as=1&qsubts=1701375318489&cs=1&q=safari%20is%20the%20new%20ie)

Couldn't help your self eh!? 😉

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 November 2023 20:27 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/5 "2023-11-30T20:27:22Z")

</div>

Perhaps, but he is right. Not sure what Apple are thinking but it is a bit embarrassing. I have my sneaking suspicion that they stay out of step with the current W3C standards:

a) because they are Apple who believe that they make the sun shine.  
b) because they hate Google who tend to drive a lot of W3C standards.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [30 November 2023 20:28 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/6 "2023-11-30T20:28:42Z")

</div>

> [@Steve-Mcl](#):
>
> Out of interest, if you fully refresh and the first thing you do is open the change node, does it still happen?

Yes, this happens too

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 November 2023 20:32 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/7 "2023-11-30T20:32:18Z")

</div>

> [@TotallyInformation](#):
>
> because they hate Google

Fun fact!

Apple have enterprise contracts with Google (the last time I read about the setup), and the last I knew - iCloud storage is hosted on Google Servers.

`Me` -\> My Encryption Key -\>` iCloud (Apple)` -\> Apples master Google Storage encryption Key -\> `Google`

 ![Screenshot 2023-11-30 at 20.35.29](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5fd09e048499f7118be03c91053ee834ffe4d64c.png)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [30 November 2023 20:38 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/8 "2023-11-30T20:38:23Z")

</div>

Google and...

 ![og__ishslgdhhimq](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/daa19de2e24a92224d560029c02c35f03d9ea193.png)

This story is going into a tailspin 😂

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 November 2023 20:39 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/9 "2023-11-30T20:39:47Z")

</div>

To get back on track

does the editor dialog close on its own?  
I get the screen fit - but nothing closes on its own (3.1.0)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [30 November 2023 20:45 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/10 "2023-11-30T20:45:01Z")

</div>

No it's the GIF loop, the editor still open

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 November 2023 20:45 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/11 "2023-11-30T20:45:20Z")

</div>

In that case, I get this crazy screen activity on 3.1.0 - but its not really causing me any issues

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 November 2023 20:47 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/12 "2023-11-30T20:47:47Z")

</div>

If this can be recreated then please raise an issue.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 December 2023 00:12 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/13 "2023-12-01T00:12:55Z")

</div>

@GogoVega I'm running on Mac mini M1 with Ventura 13.6 and Safari 16.6.

Updated to NR 3.1.1 and see no issue with opening the switch node.

What is all the background in your image? Have you got any contrib nodes installed?  
Are you running different dashboard node or have more than one installed?  
Have you tried clearing the browser cache?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 December 2023 06:57 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/14 "2023-12-01T06:57:27Z")

</div>

Thanks Paul.

This looks and smells like a safari v17.1 regression.

Ref: [[BUG]: Safari: Opening the switch node has strange behavior · Issue #4463 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4463#issuecomment-1835567076)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [1 December 2023 08:43 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/15 "2023-12-01T08:43:59Z")

</div>

Hi,  
I tested with a new basic installation and clearing the Safari cache, I still have this strange behavior

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 December 2023 13:16 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/16 "2023-12-01T13:16:45Z")

</div>

> [@GogoVega](#):
>
> I still have this strange behavior

Because, you are still using Safari 17.1 right?

This certainly appears to be a Safari regression introduced somewhere between 16.x and 17.1

> **Why do I think that?**
>
> - it was never reported for Node-RED 3.1.0 but you are seeing this on Node-RED 3.1.0 AND 3.1.1
> - @zenofmud, who has Safari 16.x has confirmed this does **not** happen on either Node-RED 3.1.0 OR 3.1.1
> - The deafening silence from every other non-safari user

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [1 December 2023 13:19 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/17 "2023-12-01T13:19:49Z")

</div>

It's very likely, unfortunately I can't test on an earlier version of Safari.

My only reluctance is why only this node?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 December 2023 13:44 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/18 "2023-12-01T13:44:14Z")

</div>

> [@GogoVega](#):
>
> My only reluctance is why only this node

Good question indeed.

I have seen this before. I _think_ when _something_ in a node setup is broken or slow to initialise (I couldn't pin it down, so never debugged it). So in fairness to all, it _might_ be a letent issue illuminated for the world to see, indirectly by whatever is going on with safari.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 December 2023 14:20 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/19 "2023-12-01T14:20:48Z")

</div>

It might be that the editor code for that node is not isolated in an IIFE. I've previously seen cases where that causes unintended side-effects. Not really that surprising given the sheer volume of shared code that is loaded in your average Node-RED installation. 🙂

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [1 December 2023 14:23 UTC](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320/20 "2023-12-01T14:23:44Z")

</div>

Possible but the `switch` node is isolated

[Next page](https://discourse.nodered.org/t/bug-opening-the-switch-node-has-strange-behavior/83320.md?page=2)
