appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: ListWidget child button unable to handle JS code with new line char in the start

Open rishabhrathod01 opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

With new line Without new line
Screenshot 2022-05-31 at 5 06 41 PM Screenshot 2022-05-31 at 5 06 48 PM

The issue seems to be due to the below logic in ListWidget.

value = `{{${parentProps.widgetName}.listData.map((currentItem, currentIndex) => {
  return (function(){
    return  ${js};
  })();
})}}`;

Steps To Reproduce

  1. Add List Widget.
  2. Add a button to the list.
  3. Paste the below JS code in the Disabled property
{{
(function(){return true;})()}}
  1. Notice this won't work

Public Sample App

No response

Version

1.7.0

rishabhrathod01 avatar May 31 '22 11:05 rishabhrathod01