Allows for link clicks to trigger a window.open call to target _blank. Currently, clicking a link simply puts the editor into isFirstResponder, which is not consistent with user expectation.
The approach here is to simply modify the editor's mouseDown event handler to detect whether the event.target is an anchor tag AND whether the editor has isFirstResponder.
A user story here might be "As a user, if I click a link in the editor while NOT editing content, the link should open a new window/tab and display the linked webpage." And "... if I click a link while IN editing mode, place the caret within the link text so that I can modify the link using the toolbar tool, if needed."
Allows for link clicks to trigger a
window.open
call to target_blank
. Currently, clicking a link simply puts the editor intoisFirstResponder
, which is not consistent with user expectation.The approach here is to simply modify the editor's
mouseDown
event handler to detect whether theevent.target
is an anchor tag AND whether the editor hasisFirstResponder
.A user story here might be "As a user, if I click a link in the editor while NOT editing content, the link should open a new window/tab and display the linked webpage." And "... if I click a link while IN editing mode, place the caret within the link text so that I can modify the link using the toolbar tool, if needed."
Unit test provided.