Skip to content

Commit

Permalink
fixes w3c#987
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad96 committed Jul 20, 2020
1 parent 2ddb55d commit 5927224
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/toolbar/js/FormatToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ FormatToolbar.prototype.init = function () {
this.textarea.style.width = (this.domNode.getBoundingClientRect().width - 12) + 'px';
this.textarea.addEventListener('mouseup', this.selectTextContent.bind(this));
this.textarea.addEventListener('keyup', this.selectTextContent.bind(this));
this.domNode.addEventListener('click', this.handleContainerClick.bind(this));

this.selected = this.textarea.selectText;

Expand Down Expand Up @@ -82,6 +83,11 @@ FormatToolbar.prototype.init = function () {

};

FormatToolbar.prototype.handleContainerClick = function () {
if ( event.target !== this.domNode ) return;
this.setFocusToFirst();
}

FormatToolbar.prototype.selectTextContent = function () {
this.start = this.textarea.selectionStart;
this.end = this.textarea.selectionEnd;
Expand Down

0 comments on commit 5927224

Please sign in to comment.