Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
colinl opened this issue May 25, 2024 · 3 comments

Comments

@colinl
Copy link
Contributor

colinl commented May 25, 2024

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
@GogoVega
Copy link

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")

@colinl
Copy link
Contributor Author

colinl commented May 26, 2024

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

@knolleary
Copy link
Member

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 knolleary transferred this issue from node-red/node-red May 28, 2024
@knolleary knolleary changed the title editableList resize() and resizeItem() callbacks not getting called when items are added or removed from the list docs: clarify editableList resize* callbacks are related to physical size, not item count May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants