Page MenuHomePhabricator

VisualEditor: Changing the selected content's formatting (heading/paragraph/preformatted) applies to the whole line, not just the selection
Closed, InvalidPublic

Description

Selecting the whole line

Steps to reproduce:

1.Open a page with VE
2.Select a text to apply the paragraph format "Preformatted".Select the text in a way so that it selects the whole line.Check the screenshot of selection to better understand.

3.Now select the option preformatted from paragraph styling options

Observed Result:
The Preformatted option gets applied to the other following text/element even though they are not selected.

If the selection is done such way that it spans multiple empty lines then the preformatted options gets applied to those empty lines too.

See the screenshots attached.

Test Environment: http://en.wikipedia.beta.wmflabs.org/
Browser: Chrome Version 26.0.1410.65
OS: MAC OS X 10. 8. 5
Page:http://en.wikipedia.beta.wmflabs.org/wiki/28th_december


Version: unspecified
Severity: normal

Attached:

Screen_Shot_2013-12-28_at_1.24.46_PM.png (528×1 px, 108 KB)

Details

Reference
bz59089

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:34 AM
bzimport set Reference to bz59089.

Created attachment 14183
Selecting multiple lines

Attached:

Screen_Shot_2013-12-28_at_1.24.27_PM.png (512×1 px, 86 KB)

Created attachment 14184
Observed Result

Attached:

Screen_Shot_2013-12-28_at_1.25.07_PM.png (430×1 px, 16 KB)

Yes, content formatting applies to the line(s) selected, not the text selection. This is by design (rather than splitting the text). Closing as WONTFIX, but happy to discuss if someone things we should split instead.

Sorry, I think I could not explain it properly in my steps.The issue was not about applying the format on the whole line rather on an immediate following line which was not selected.

For example the content of a page is as follows:

The text
another text

Not selected text

Now if you select "the text" and "another text" but stop the selection just above the line "Not Selected text" and apply the format, it gets applied to "Not Selected text"

So, I am reopening the bug again as it is a different issue.

The selection of the following line is different than selecting the text on the line. If you choose to select just the text, you will get the behavior you are looking for. If you select the line and it's break (or empty lines after it) then you will get the behavior you are reporting as a bug.

This is not a bug, it's doing exactly what it should. However, it may be valuable to revisit how we can better communicate what is selected and how to achieve the desired result to the user.

Unfortunately, we have limited control over selection because we use ContentEditable, which is provided by the browser. The selection of a line and it's break may be something we can disable, but likely there will be negative effects on user experience and browser compatibility.

Marking as invalid, since this is not a bug, but a known feature. I'm happy to discuss the UX impact of this feature and possible changes that could improve the situation on a different, enhancement, bug.