[Bug]: Dynamic menu items lose reference to currentItem in list. #35706
Labels
Bug
Something isn't working
Community Reported
issues reported by community members
High
This issue blocks a user from building or impacts a lot of users
Menu Button Widget
Issues related to Menu Button widget
Needs Triaging
Needs attention from maintainers to triage
Production
Widgets & Accelerators Pod
Issues related to widgets & Accelerators
Widgets Product
This label groups issues related to widgets
Is there an existing issue for this?
Description
Dynamic menu buttons lose reference to
currentItem
inside of theonClick
event when the widget is inside of a list.Using
currentItem.value
within the onclick event of a dynamic menu item works as is, but when the menu is inside of a listcurrentItem.value
isundefined
.Steps To Reproduce
Create a
Menu Button
widget.Set the menu items source to "Dynamic".
Set the "Source data" to the following or something similar
{{[{ label: 'test1', value: 'banana'}, { label: 'test2', value: 'orange'}] }}
.Configure the menu items as follows, and as seen on the example page.
Label:
{{ currentItem.label}}
;Onclick:
{{showAlert(currentItem.value, 'success')}}
;Click on one of the options and the showAlert will pop up with the value.
Drag and drop or copy the menu button widget into a list item, and it will return
showAlert expected STRING for 'message' argument but received UNDEFINED
.Public Sample App
No response
Environment
Production
Severity
High (Blocker to building or releasing)
Issue video log
No response
Version
Self hosted: v1.14 and also v1.23
The text was updated successfully, but these errors were encountered: