Open spreadred opened 6 years ago
From the mozilla docs on executecommand:
createLink Creates an anchor link from the selection, only if there is a selection. This requires the HREF URI string to be passed in as a value argument. The URI must contain at least a single character, which may be a white space. (Internet Explorer will create a link with a null URI value.)
It appears as though the solution to this is going to be creating a fake one character selection at the cursor position if nothing is selected.
@kaptainkommie I fixed this issue with my latest commit #126 Basically we will create a fake text element and move selection to that element when there is no current selection. Thanks for taking a look at it.
It seems as though only Chrome is capable of adding a hyperlink directly from the hyperlink button, without having previously typed the text for the link and then selected it prior to clicking the hyperlink button.
Steps to reproduce:
I'm not sure what the desired behavior is, but I think Chrome's behavior is likely the desired behavior by the end user.