Strange behaviour of multitext with Tab key

Hi there,
we have observed a strange behavior of the multitext component.

If you first add a new line via the plus, then enter text in the first field and press the Tab key to switch to the next line, the line disappears.

You can reproduce this behaviour in the multitext example by deleting the mail address, which is already entered: https://snippet.webix.com/9239c2e6.

Is this a known Bug or is there any way to prevent the lines from disapperaing?

Thanks in advance
Gorden

Tagged:

Comments

  • edited May 27

    @Gorden
    this behavior looks like intended.
    but if you really need to keep empty values then try to apply this hack

    (function(){
      let getValueHere = webix.ui.multitext.$protoWait[0].getValueHere;
      webix.ui.multitext.$protoWait[0].getValueHere = function(){
        let value = getValueHere.apply(this, arguments);
        if(!value && this.config.mode == "extra"){
          value = "\u200c"; //replace empty value with invisible char
        }
        return value;
      }
      let push = Array.prototype.push;
      Array.prototype.push = function(){
        if(arguments[0] === "\u200c"){
          arguments[0] = ""; //replace invisible char with empty value on push used in code
        }
        return push.apply(this, arguments);
      }
    })();
    

    https://snippet.webix.com/18seabqe

  • @integral

    thanks for the fast answer, this is exactly the fix that I needed.
    With this I don't want to keep empty values. I want to add all input fields, then fill them one after another by jumping to the next one with Tab.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion