Clone options
Hi we found an incosistent behavior when giving the option's parameter to the clone methode.
https://github.com/SAP/openui5/blob/657a2c4fd2043b16cd984d45704201eba9dce974/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L4868-L4875
when passing undefined as option bCloneChildren and bCloneBindings will both be set to true. When passing an Object with only one of the two set to false or true the other will also be set to false because oOptions.b... is undefinded and gets converted by the double ! to false.
Hello @sebbi08, Thank you for share your enhancement proposal. I've created an internal incident 1980202617. The status of the issue will be updated here in GitHub. Regards, Wenqian
Hi,
I do not see the propblem here. Setting e.g. cloneBindings to undefined is similar to setting it to false. There is good reason for defining it that way.
Regards Silke
exept that we dont set cloneBindings to undefined explicitly. But rather get this result because we set cloneChildren to true. Maybe this should be some how be documented.
We are aware and share your opinion but I do not see good chances to change the behavior here. I tried to do that so many times in ManagedObject and ManagedObjectObserver but allways failed. So I am quite sure that @codeworrior has no good chances to change this.
How about that we change the documentation an bit like this https://github.com/SAP/openui5/pull/2498 so we dont have to debug the code to see why sundently out bindings / children wont get cloned
Sure I will provide a change and let you and @codeworrior have a look here.