Browser issue Alignment to the left/right

Moshe1010

Well-known member
When double clicking (OS X/Win 8 Chrome 35) on a phrase and trying to align it the right, it brings the entire text below it to the right as well (sometimes the entire paragraph, sometimes just several lines):
http://s1.uploads.im/E6lpA.gif

The raw bb-code looks like this:
[RIGHT]sfgasg asg asg asg asg asg asg asg asg asg as ga
In a report from Daily Star, Bilzerian apparently suffered two heart attacks, which likely came from taking hard[/RIGHT]
[LEFT]drugs. "I had been partying for four days without a break," he told The Sun. "I was doing drugs, such as coke and ecstasy, and met a stripper who came back to my place," he added. Bilzerian also admitted to taking viagra, which also caused some damage. "I popped a viagra and nothing happened so I took another one and then boom. Next thing I remember is waking up in the hospital," he said.[/LEFT]

It takes the "Right" tag for the first line, and wraps it for some reason for the second one as well.


This occurs only if the phrase is selected by double clicking (works only with chrome I guess).
 
I should note that it's actually triple click in Windows.

This is actually done within the browser's own behavior and I can't totally blame it. When you trigger this, your cursor is actually this:
Rich (BB code):
{AAAA
}BBBB
You can confirm this by pressing a key. You'll see that what's inserted will be on the same line as BBBB. (This indicates that the cursor is actually in the <p> tag that represents that line.)

The browser will align any paragraphs that your cursor is touching, so this covers both AAAA and BBBB. In that regard, it is behaving as expected. Note that you don't need to do any highlighting to align a paragraph. It's like lists and a few other tags and is applied to the whole current paragraph.

This is mostly down to how the browser decides to manage the selection. It believes that the second paragraph is part of the selection. Trying to do any manipulation is very likely to lead to more inconsistencies.
 
Back
Top Bottom