node-red.github.io icon indicating copy to clipboard operation
node-red.github.io copied to clipboard

docs: clarify editableList resize* callbacks are related to physical size, not item count

Open colinl opened this issue 1 year ago • 3 comments

Current Behavior

It appears that the resize() and resizeItem() callbacks on editableList do not get called as they should when an item is added or removed from the list, unless I am misunderstanding the docs. resize() does get called when the node dialog is initially opened, but not thereafter and resizeItem seems never to be called at all. I have not attempted to use them before so don't know whether they have ever worked.

See also forum post https://discourse.nodered.org/t/problem-with-editablelist-resize-callback/88263 where @marcus-j-davies confirms the behaviour (of resize at least).

Expected Behavior

No response

Steps To Reproduce

No response

Example flow

paste your flow here

Environment

  • Node-RED version: 3.1.9 and 4.0.0-beta.3
  • Node.js version: 20.5.1
  • npm version:
  • Platform/OS:
  • Browser: Edge on Ubuntu

colinl avatar May 25 '24 16:05 colinl

The documentation is not entirely correct - resize() and resizeItem() are called when:

  • the list is created - $("ol.list").editableList({})
  • the width changes - $("ol.list").editableList("width", "100px")
  • the height changes - $("ol.list").editableList("height", "100px")

GogoVega avatar May 25 '24 18:05 GogoVega

OK, thanks. Yes, the docs are at least ambiguous.

colinl avatar May 26 '24 06:05 colinl

Right - these callbacks are related to the physical space of the list, rather than changes to how many items are in the list. I'll transfer this over to the website repo so we remember to update the docs.

knolleary avatar May 28 '24 09:05 knolleary