Closed Bug 324078 Opened 19 years ago Closed 18 years ago

Selection of text within anchor tags displayed as block-level elements is impossible.

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bugs, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060119 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060119 Firefox/1.6a1

If an anchor tag is displayed as a block-level element it is impossible to select the text using the mouse unless dragging is commenced from outside the anchor element. Dragging anywhere within the anchor element causes a drag+drop of the link to be initiated. While this is most likely intended behaviour it makes selection of the link text (as opposed to href URL) very difficult.

Reproducible: Always

Steps to Reproduce:
1. Create page with anchor element.
2. Use CSS to display anchor element as block-level e.g. "display: block;".
3. Attempt to select text inside anchor element by dragging mouse from within anchor element.
Actual Results:  
A drag and drop of the hyperlink is initiated.

Expected Results:  
The text is selected.
Component: General → Layout
Keywords: testcase
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk
How is this a bug? The element is a block-level element, therefore shouldn't it display just like the <p> above it does? You can't select the text in the link because the whole block (which spans the viewport) is a link.
Component: Layout → Layout: Block and Inline
OS: Windows XP → All
Hardware: PC → All
(In reply to comment #2)
> How is this a bug? The element is a block-level element, therefore shouldn't it
> display just like the <p> above it does? You can't select the text in the link
> because the whole block (which spans the viewport) is a link.
> 

It is a bug, because it makes selection of the link text almost impossible.

In earlier versions (including 1.5) it works, but after selecting the text if you release the mouse over the anchor element the link is activated. Obviously one wants the link to be activated if you click anywhere on the anchor element, but not if you are trying to select the text. So there should be a difference in behaviour.
The behavior of not being able to select on text that's a link seems reasonable.  The only thing that seems odd to me is that you can't select the text in the link by starting the drag from below the link -- only when starting from above it.
So, is there anything here not covered by bug 290831?
(In reply to comment #5)
> So, is there anything here not covered by bug 290831?

That is to do with selection removal, this is to do with the selection in the first place.
Depends on: 253076
Try using the block level anchors at this URL including the drop down CSS style switcher at the top right...
http://www.jabcreations.com/home/

It will create a horizontal scrollbar and most users will have difficulty accessing such links.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060218 Firefox/1.6a1

The problem with selection that dbaron mentioned WFM. Note that the original issue described is INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060410 Firefox/3.0a1

Nope, not fixed, see any of the block anchors on the sidebar of my site...

http://www.jabcreations.com/home/home-news.php

This bug is not resolved, it still creates a horizontal scrollbar.
The horizontal scrollbar is caused by the focus outline extending outside the blocks; in any case, it's not relevant to this bug.

To fix your site, try putting a couple pixels of margin around the links, to give space for the outline to display.
Outline is not a CSS property.  Either it is part of this bug or I should post a new bug report, which is it?
Sorry for not making myself clear.

I just did a bit of searching; looks like you want Bug 286368
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: