firepad icon indicating copy to clipboard operation
firepad copied to clipboard

Starting selection by clicking on bullet results in browser's built-in selection and incorrect behavior.

Open benbro opened this issue 12 years ago • 11 comments

[Repurposing this issue to track the issue discussed in the comments below].

For posterity, the original issue (which may require changes to CodeMirror to fix):


Please see the attached image. Tested with FF 25

firepad-select1

benbro avatar Nov 15 '13 10:11 benbro

FYI- Fixing this would probably require changes to CodeMirror (the underlying editor), so I'm inclined to close this issue unless you feel strongly about it. I'd gladly accept a pull request if anybody comes up with a fix, of course. :-)

mikelehen avatar Nov 15 '13 17:11 mikelehen

I didn't realize it will require a change in CodeMirror. That will probably be a problem because rich text editing is not a core goal of it. I'm attaching more images to show an issue when selecting the actual html and not with CodeMirror range selection. This all adds up to usability problems but I understand the tradeoff so feel free to close this issue. firepad-selection3 firepad-selection4

benbro avatar Nov 15 '13 18:11 benbro

Can you elaborate on what the bottom picture is showing?

mikelehen avatar Nov 15 '13 18:11 mikelehen

The top picture shows that I can select the actual html without the CodeMirror range color. The bottom picture shows the result of pasting this selection.

benbro avatar Nov 15 '13 18:11 benbro

How are you selecting the HTML? Are you doing it programmatically? I won't be at all surprised if that causes problems. There's a reason CodeMirror implements selection itself. :-)

mikelehen avatar Nov 15 '13 18:11 mikelehen

I'm selecting with the mouse in FF. try to create a list and start selecting from the left of the bullet point to reproduce.

benbro avatar Nov 15 '13 18:11 benbro

Eww. Sure enough. That is unfortunate. I'll see if there's some way we can fix that. Maybe the bullet placeholder is consuming mouse events when it shouldn't or something.

mikelehen avatar Nov 15 '13 18:11 mikelehen

Is it possible to show list bullets with something similar to how CodeMirror handles tabs? This demo shows that it's possible to select the tabs without any problem: http://codemirror.net/demo/visibletabs.html

benbro avatar Nov 15 '13 19:11 benbro

Perhaps. What we're currently doing isn't terribly different... but there is a <div> involved (to insert space). Maybe that's the problem. Not sure.

mikelehen avatar Nov 15 '13 20:11 mikelehen

There is another issue with selection. Try selecting a list where the last line is empty and change the list type. When changing from unordered to ordered the last item in the list isn't changed. firepad-selection4

benbro avatar Nov 15 '13 20:11 benbro

I'd welcome a pull request to fix that. :-)

mikelehen avatar Nov 15 '13 21:11 mikelehen