Is it possible to remove focus from ZK combobox after list appears?

- 1 answer

Ad

IE 10 has a bug https://connect.microsoft.com/IE/feedback/details/841043/blinking-text-cursor-overlapping-with-div

But I need somehow remove blinking cursor in ZKoss Combobox. The primary idea is to remove focus from input and try to get it to popup list. I think that if focus will be removed, blinking curcor doesn't appears behind popup list.

How can I remove focus from combobox's input after the popup list appears? Is it possible?

Ad

Answer

Ad

Seems like I solve it!

The point is to override method open of ZKoss's Combobox.

var _Cwgt = {};
zk.override(zul.inp.Combobox.prototype, _Cwgt, {
  open: function (silent) {
    var id = '#' + this.uuid + '-pp'; // get id of popup
    _Cwgt.open.apply(this, arguments); // call original
    jq(id).focus(); // give focus to the popup
  }
});
Ad
source: stackoverflow.com
Ad