Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

WSTreeView in DropDown - tiny bug: empty preselection causes error #54

Closed FlowIT-JIT closed 5 years ago

FlowIT-JIT commented 5 years ago

A bug in our software revealed a tiny bug in WSTreeView. WSTreeView.SetSelections(..) allows for empty string values to be added to preSelections (https://github.com/Jemt/Fit.UI/blob/master/Controls/TreeView/WSTreeView.js#L712). This results in an error when the drop down is opened and data is fetched and selected in TreeView because TreeView.Title(..) gets called with an empty title which is not allowed (https://github.com/Jemt/Fit.UI/blob/master/Controls/TreeView/TreeView.js#L1490).

So with this it is possible to force a WSDropDown control (which hosts a WSTreeView) into a "sick state" by assigning an empty selection: WSDropDown.SetSelections([{ Title: "", Value: "" }]).

Unlikely, but it happened to us.