Skip to content

Lost focus when click between buttons or when keep key pressed  #19

@RicardoBer

Description

@RicardoBer

There are several wrong behaviors derived from the fact that when you click on the keyboard the imput lose the focus.

The idea under this propouse is that if you click in any point of the keyboard it must return the focus to the current input.

I propouse this change to Keyboard.prototype.init

Keyboard.prototype.init = function() {
  this.$keyboard.append(this.renderKeys());
  this.$keyboard.append(this.$modifications_holder);
  $("body").append(this.$keyboard);

  if (this.options.is_hidden) this.$keyboard.hide();

  this.setUpKeys();
  //INIT MOD 2018-11-01
  var _this = this;
  this.$keyboard.on('click', function (){ 
    if(_this.$current_input) 
      _this.keep_focus = true;
      _this.$current_input.focus(); 
  })
  //END MOD 2018-11-01
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions