appsmith
appsmith copied to clipboard
[Bug]: Widget is visble in view mode even when evaluated value of the "Visible" property is false
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
A widget is visible in the view mode even when binding with a Modal widget is done in such a way such that if the Modal widget is visible, then only the other widget should be visible.
Steps To Reproduce
- D&D a button & a Modal widget.
- Now configure the
Visible
property of the Button widget as:{{Modal1.isVisible}}
. - Deploy the app.
- The button widget will be visible by default for the first time on view mode.
Expected: The button widget shuld not be visible in the view mode for the first time also
Public Sample App
No response
Environment
Production
Issue video log
https://www.loom.com/share/7a533d184ce343a7a6a9ba62f2d7714b
Version
Cloud
This is happening because when the page loads the modal isVisible
property is undefined. Maybe it does not have a default value. @keyurparalkar do you know what can be the implications of setting a default value on this prop
cc @rajatagrawal
@somangshu if the value is set to undefined then shouldn't it come as false?
@dilippitchika the value right now if undefined after the eval cycle. Since our output is undefined the issue occurs. undefined and false are different type / value.
Both undefined and null are falsy by default. So == returns true. But when we use the strict equality operator (===) which checks both type and value, it returns false