Skip to content

Commit

Permalink
Fix: Allow textarea to be interactable in certain scenarios (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Apr 16, 2018
1 parent aea1cfa commit 9ce5b0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/PointModeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class PointModeController extends AnnotationModeController {
this.pointClickHandler = this.pointClickHandler.bind(this);

// Get handlers
this.pushElementHandler(this.annotatedElement, ['mousedown', 'touchstart'], this.pointClickHandler);
this.pushElementHandler(this.annotatedElement, ['click', 'touchstart'], this.pointClickHandler);

this.pushElementHandler(this.exitButtonEl, 'click', this.toggleMode);
}
Expand Down
12 changes: 11 additions & 1 deletion src/controllers/__tests__/PointModeController-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,20 @@ describe('controllers/PointModeController', () => {

describe('setupHandlers()', () => {
it('should successfully contain mode handlers', () => {
sandbox.stub(controller, 'pushElementHandler');
controller.exitButtonEl = 'also definitely not undefined';

controller.setupHandlers();
expect(controller.handlers.length).to.equal(2);
expect(controller.pushElementHandler).to.be.calledWith(
controller.annotatedElement,
['click', 'touchstart'],
controller.pointClickHandler
);
expect(controller.pushElementHandler).to.be.calledWith(
controller.exitButtonEl,
'click',
controller.toggleMode
);
});
});

Expand Down

0 comments on commit 9ce5b0a

Please sign in to comment.