Hello, I have a method on change of a dropdown quantity that makes a button in the same repeater item visible and once the button is clicked it should set itself to hidden after doing a few things (see code below). I get an error message on my second and consequent changes.
Few more notes: This only started recently with no changes in quite some time. I have two repeaters the first repeater is the categories which when clicked gets all the items and updates a second repeater for all the items in that category (All the other fields, name and other things are properly set)
Important: I am only seeing this on Live Mode, Cannot replicate in Preview mode. This happens when I choose my second and consequent categories in the category repeater which shows the fields and updates the item repeater just fine but has errors when either of the functions below are called
export function dropdownQty_click ( event ) {
let button = $w . at ( event . context );
console . log ( button ( “#btnAddItem” ). rendered ); // true
console . log ( "Hidden " + button ( “#btnAddItem” ). hidden ); //true
console . log ( "Collapsed " + button ( “#btnAddItem” ). collapsed ); //false
button ( “#btnAddItem” ). show (). then (() => { console . log ( “success” )}). catch ( ( err ) =>
{ console . log ( err )}); //TypeError: undefined is not an object (evaluating ‘le[e][n]’)
}
export function btnAddItem_click ( event ) {
var currentItem = $w . at ( event . context );
var itemName = currentItem ( “#txtItemName” ). text ;
var quantity = currentItem ( “#dropdownQty” ). value ;
var itemWeight = currentItem ( “#txtItemWeight” ). text ;
…
currentItem ( “#btnAddItem” ). hide (). then (() => { console . log ( “success” )}). catch ( ( err ) => { console . log ( err )} ); //TypeError: undefined is not an object (evaluating ‘le[e][n]’)
}