-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement seamless link insertion and editing using just keyboard #4720
Comments
The status of things is as follows: If I press CTRL+L, type URL, enter. Then a link with a text==href is inserted. The link is fully selected, but I'm not able to change its text, cause that cause deleting it. Unfortunately, this makes sense... :D. When I'm thinking about this now, I see that the only option which won't require hacking the selection requires adding a "text" input to the link dialog. And there are two options:
If you think that the first solution is OK, then I'd go with it simply because it's simple and should be better than what we have now anyway :D. |
PS. The biggest issue right now is that you cannot easily edit the whole text of a link, cause it disappears... |
Would something like this work, when the whole link is selected?
This would work when creating links on collapsed selections as well. We could select the whole link after creating it with the link URL as the initial text. The the above options would apply. |
I've been thinking about this too, but it'd require hacking the typing feature a bit. One option would be to change the behaviour of So we'd need to be more specific and affect typing only. We plan to expose it as a command, but then you can hook in only before (useless because selection is not collapsed yet) or after (but then you don't know what was inserted and we cannot rerender content during composition anyway). In other words, changing the behaviour of input will be tricky. We'd need to carefully think on that algorithm and hooks we expose. Perhaps it will be worth to do this anyway, but this isn't my only worry. The second reason why I'm afraid about such a solution is that its discoverability is hard to predict. We don't know how many users won't automatically start pressing backspace before typing something. If they do so, then they won't learn how to override the text. Users may also start wondering how to specify the text when still inside the link balloon. There's no promise there that they will be able to change the text later. tl;dr: I think this could be a nice enhancement in the future, but it shouldn't be the only way. |
This is not an option. A magical field, which is displayed only in some cases is a UX nightmare. People will get confused/angry because it is displayed in some cases and sometimes it is not. We can either show it no matter what case (just like Google did) or ditch the idea and keep things simple, which is just as bad (see "cons" in https://github.com/ckeditor/ckeditor5-link/issues/11#issue-172902804).
I'm also concerned with discoverability of such implementation. It's not very clear what happens when and people might just get as confused as with the disappearing text field I mentioned. But don't worry. This is but an improvement to the overall UX. It's not essential at this moment. It's OK that we don't know what to do yet, really (!). Let's give the feature a break and see how it performs in some real–life integrations. Let's give it some time and then go back to see what could be done to make the feature even more amazing with a better understanding of the problem, with more knowledge about the needs of our users. |
So +1 for what Google did. |
In the topic of typing over a link and replacing link text: w3c/editing#156. |
And typing after a link: w3c/editing#156. |
The current behavior is much better than in the past. Right now, you can do that:
So, it's not as short as it could be if we added additional input to the link balloon but it's quite ok right now. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
A followup of https://github.com/ckeditor/ckeditor5-link/issues/2#issuecomment-240374891
Also
I see 2 possible approaches to the problem:
Type link text in editable
Once the user types the URL and confirms it by pressing Return, an empty (virtual) link is created, which text can be typed directly in editable.
Pros:
Cons:
Anyway, it's not a very good UX if you get stuck in link text typing and switching back to regular typing is not quite obvious.
Type link text in the panel
This is what Google Docs implemented after they encountered, I'm sure, some of the problems described above.
Pros
Cons
Trade–offs
In case of formatting in selected text, Google simply discards it when displaying the text in the panel and then retains it as it gets linked. If the user changed anything in the link text input in the panel, the formatting is discarded completely.
As for the multi–line selection, Google solves the problem by simply preventing user from editing text in the panel:
It's seems the only sane way of addressing the "cons" but it still requires an extra effort from developers and could be confusing for the users. OTOH, these are rather edge cases so I'm ready to accept this kind of trade–off.
WDYT?
The text was updated successfully, but these errors were encountered: