# 🎉 Node-RED 2.1.1 released

**URL:** https://discourse.nodered.org/t/node-red-2-1-1-released/52554
**Category:** News
**Created:** [22 October 2021 08:38 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554 "2021-10-22T08:38:45Z")
**Posts on this page:** 14
**Page:** 2

<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: [24 October 2021 18:30 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/21 "2021-10-24T18:30:28Z")

</div>

> [@Hypnos](#):
>
> In the past I had some problems there with env and with global and flow contexts, which only working properly if I set the type first and then the value.

I have to add, for future reference, _please report issues like this_ rather than find code workarounds.

---

<div class="post-metadata">

### Author: ![jens\_rossbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jens_rossbach/32/98717_2.png) [@jens\_rossbach](https://discourse.nodered.org/u/jens_rossbach)
#### Post date: [24 October 2021 19:37 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/22 "2021-10-24T19:37:17Z")

</div>

Here is the link to my nodes for reference:

> **[GitHub - jensrossbach/node-red-contrib-chronos: Time-based Node-RED...](https://github.com/jensrossbach/node-red-contrib-chronos)**
>
> Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes - GitHub - jensrossbach/node-red-contrib-chronos: Time-based Node-RED scheduling, repeating, queueing,...

The effected nodes as I observed so far are the scheduler and the time change nodes.

---

<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: [24 October 2021 19:47 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/23 "2021-10-24T19:47:44Z")

</div>

> [@jens\_rossbach](#):
>
> Here is the link to my nodes for reference:

Thanks - but to save me digging through to find what TypedInput is having an problem, can you give me some steps to recreate ? Which field should I be looking at?

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [24 October 2021 20:49 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/24 "2021-10-24T20:49:16Z")

</div>

Experienced same with the node-red-contrib-ui-state-trail. The order of commands matter. `typedIput("value", value)` and then `typedinput("type", type)` ends with the empty value field when in ediatableList the creation runs on existing rules. It wasn't problem previously.

---

<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: [24 October 2021 20:58 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/25 "2021-10-24T20:58:28Z")

</div>

@hotNipi again, I have to ask, which field should I be looking at? I have got fixes lined up for this, but want to test it against more nodes.

---

<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: [24 October 2021 21:10 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/26 "2021-10-24T21:10:55Z")

</div>

Your scenario is a bit different to the others.

You are defining your TypedInput with the types 'bool', 'str', 'num'. Because you don't tell it what to set its type it, is assumes you want 'bool'.

A few lines later you then set the value. But as the type is still 'bool' it is expecting true/false values. As you are setting the user-provided 'string' value... which doesn't match any of the valid options, it doesn't accept it.

Previously this worked because it let you set invalid values, getting the internal state inconsistent, but then 'resolved' by calling 'type' to change it to a 'str' type input. The only fix I can see is to not have the TypedInput validate you are setting valid values... which isn't ideal.

I will look at what we can do - it isn't my intention to break this. Moving forward, I can recommend some changes to how you are using the TypedInput.

1. when you are creating your TypedInputs and you already know what type the field should have, make sure you set the `default` property in the constructor function call.

2. if you know the value the input should have, set the value of the `<input>` _before_ you call the TypedInput constructor

Doing it this way avoids the need to explicitly call the `type` or `value` functions of the input after constructing it.  
I believe taking those two steps will avoid this issue and be 100% backward compatible (ie you shouldn't stumble over other issues doing that with older versions of the TypedInput).

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [24 October 2021 21:16 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/27 "2021-10-24T21:16:41Z")

</div>

Thank you. Clear and constructive as always 🙂

---

<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: [24 October 2021 22:11 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/28 "2021-10-24T22:11:07Z")

</div>

@hotNipi@jens_rossbach@Hypnos

I believe I have fixed the issues with the TypedInput initialisation. It should behave consistently with pre2.1.

However please do see my previously reply above for best practices on initialising the TypedInput correctly.

The good news is I know have added about 20 test cases (albeit ones that have to be manually verified) to the Node I use to check the behaviour of the TypedInput across a wide range of initialisation/setting type/setting value sequences.

We will get 2.1.2 published tomorrow morning.

---

<div class="post-metadata">

### Author: ![jens\_rossbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jens_rossbach/32/98717_2.png) [@jens\_rossbach](https://discourse.nodered.org/u/jens_rossbach)
#### Post date: [25 October 2021 07:36 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/29 "2021-10-25T07:36:04Z")

</div>

@knolleary Sure, here are some details.

For the scheduler node, please look at file "nodes/scheduler.html". The affected widget is `outType` which is first declared at line 286.

For the time change node, please look at file "nodes/change.html". The affected widget is `property` which is first declared at line 280.

One additional information: The issue only happens for the "msg" type but not for e.g. the "flow" and "global" types.

---

<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: [25 October 2021 08:52 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/30 "2021-10-25T08:52:48Z")

</div>

Thanks @jens_rossbach - I've just released 2.1.2 that should fix all of the issues raised here.

I tested it with both of your nodes and the others mentioned (although I never did find out which nodes @Hypnos was referring to).

If you still see any odd behaviours, please raise them as issues. As I've said, its important that we don't regress behaviour - even if we do update the best practices to follow.

> [@tada Node-RED 2.1.2 released](https://discourse.nodered.org/t/node-red-2-1-2-released/52691):
>
> Node-RED 2.1.2 is now available. This has resolved the outstanding issues with the TypedInput widget - but do let us know if you see anything odd.

---

<div class="post-metadata">

### Author: ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)
#### Post date: [25 October 2021 12:41 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/31 "2021-10-25T12:41:10Z")

</div>

> [@knolleary](#):
>
> although I never did find out which nodes @Hypnos was referring to

My nodes are the [GitHub - rdmtc/node-red-contrib-sun-position: This is a ultimate Node-Red Timer, Sun, Moon and Blind flow control.](https://github.com/rdmtc/node-red-contrib-sun-position). Since I am currently on vacation, I unfortunately cannot test it.

---

<div class="post-metadata">

### Author: ![jens\_rossbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jens_rossbach/32/98717_2.png) [@jens\_rossbach](https://discourse.nodered.org/u/jens_rossbach)
#### Post date: [25 October 2021 17:24 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/32 "2021-10-25T17:24:25Z")

</div>

I tested it also on my side and can confirm that the issue is solved.

About the other problem (I know it's just a cosmetic one) with the spinner widget: do you have an idea what happended? The function node and inject node show the same: the spinner widget has a smaller height and width and the content has no padding to the borders which does not look so nice.

This is how it looked on older Node-RED versions:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/9933a6c1100c142f0e1295f5d6b48574ea750c65.png)

This is how it looks since Node-RED 2.1.x:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf0152d2cbeb1dc89b3dcd1d92cdc86f0f944fca.png)

Before, the spinner widget had the same height as the typedInput widget or normal input fields and was also wider. Now it looks quite compact.

---

<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: [26 October 2021 09:51 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/33 "2021-10-26T09:51:17Z")

</div>

The spinner should be back to the correct appearance with NR 2.1.3

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [25 December 2021 09:51 UTC](https://discourse.nodered.org/t/node-red-2-1-1-released/52554/34 "2021-12-25T09:51:33Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/node-red-2-1-1-released/52554.md?page=1)
