Use isCollapsed instead

Turns out that the isCollapsed I was seeing was different because the node had lost focus and thus the actual value was different every time. Thanks @theefer. Also removed erroneous keycode