Closed Bug 883895 Opened 11 years ago Closed 2 years ago

Part of <select> popup is off-screen if <select> is near the edge of the screen

Categories

(Core :: Layout: Form Controls, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: firefox, Unassigned)

References

Details

(Keywords: reproducible, testcase)

Attachments

(2 files)

Attached image drop-list error.jpg
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

Steps to reproduce:

When the SELECT element is close to the right of the physical screen, it is displayed partly off screen. See screenshot.


Actual results:

When the SELECT element is close to the bottom of the physical screen, it is displayed partly off screen. See screenshot.


Expected results:

It should be displayed.
Group: core-security
Reporter, could you please provide a link to a public page that has this issue?
Flags: needinfo?(firefox)
(In reply to Alexandra Lucinet [QA] from comment #2)
> Reporter, could you please provide a link to a public page that has this
> issue?

http://hobby.dn.ua/123/address_book.html
Flags: needinfo?(firefox)
(In reply to firefox from comment #3)
> (In reply to Alexandra Lucinet [QA] from comment #2)
> > Reporter, could you please provide a link to a public page that has this
> > issue?
> 
> http://hobby.dn.ua/123/address_book.html

select from "Warehouse" drop-list
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Form Controls
Ever confirmed: true
Product: Firefox → Core
Summary: Selecting drop-list error → Part of <select> popup is off-screen if <select> is near the edge of the screen
Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20100101 Firefox/22.0
Mozilla/5.0 (Windows NT 6.1; rv:23.0) Gecko/20100101 Firefox/23.0
Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20130718 Firefox/24.0
Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20130718 Firefox/25.0

It works for me with Firefox 22.0 (Build ID: 20130618035212), Firefox 23 beta 6 (Build ID: 20130715155216), Aurora 24.a02 (Build ID: 20130718004004) and Nightly 25.0a1 (Build ID: 20130718030201): when I resize the window, the Warehouse drop-down list is displayed entirely, but off screen. I've encountered the same behavior with Opera and Chrome.

Reporter, is it still an issue for you with the latest builds?
Flags: needinfo?(firefox)
Yes, this is still current. On Windows (steps courtesy of the dupe):

Open your browser to [maximized mode]
Visit https://bugzilla.mozilla.org/page.cgi?id=productdashboard.html

Through any inspector (embedded or Firebug), set the following css styles:

select[name="product"] {
    width: 90px;
    float: right !important;
}

then click the product selector which is now on the far right of the screen.

The right side of the dropdown is displayed offscreen.

Neil, do you know anything about this code, and/or do you know someone who does?
Flags: needinfo?(firefox) → needinfo?(enndeakin)
Version: 21 Branch → Trunk
I don't. Might ask mats about this though, I think.
Flags: needinfo?(enndeakin) → needinfo?(mats)
We don't have any code that adjusts the x-offset of the dropdown menu to try to keep it
inside the screen edges horizontally (we do it vertically though).  Adding that functionality
seems like a reasonable enhancement request though.
Flags: needinfo?(mats)
OS: Windows 7 → All
Hardware: x86_64 → All
Can anyone give me the info on where is the code for this located? I want to take a look. (and possibly modify, at least for myself).
Flags: needinfo?(mats)
GetAvailableDropdownSpace() calculates the available space above / below the contol.
It might be possible to extend to also calculate available space to the left / right.
http://mxr.mozilla.org/mozilla-central/source/layout/forms/nsComboboxControlFrame.cpp#546

Near the end of AbsolutelyPositionDropDown() there's some code that shifts the menu
horizontally for RTL.  That's probably a good place to take the available left / right
space into account.
http://mxr.mozilla.org/mozilla-central/source/layout/forms/nsComboboxControlFrame.cpp#604
Flags: needinfo?(mats)
(In reply to Mats Palmgren (:mats) from comment #12)
> GetAvailableDropdownSpace() calculates the available space above / below the
> contol.
> It might be possible to extend to also calculate available space to the left
> / right.
> http://mxr.mozilla.org/mozilla-central/source/layout/forms/
> nsComboboxControlFrame.cpp#546
> 
> Near the end of AbsolutelyPositionDropDown() there's some code that shifts
> the menu
> horizontally for RTL.  That's probably a good place to take the available
> left / right
> space into account.
> http://mxr.mozilla.org/mozilla-central/source/layout/forms/
> nsComboboxControlFrame.cpp#604

Thanks for the info. I've another query though, Do we have any code that returns the width of th control (combobox in this case). I was looking through the links provided and could not find/implement the "width" equivalent of "GetHeightOfARow" . If there is some code available to do that. Can you please point me to the code. I am sorry I couldn't understand much source codes and search.
I think you can use GetRect() here to get the position and size of the nsComboboxControlFrame.
This looks to be solved when E10 is enabled. (i.e., in Nightly)

The UI is a bit different (and nice) though. Does this mean this will no longer be any bug in the near future?

And Is there any Code documentation that I could possibly read and figure out about different functions?
Flags: needinfo?(mats)
(In reply to nootan.ghimire from comment #15)
> Does this mean this will no
> longer be any bug in the near future?

Yeah, perhaps this isn't worth fixing for non-e10s.  There are lot's of other
bugs to work on if you want to, see:
https://developer.mozilla.org/en/docs/Introduction#Step_2_-_Find_something_to_work_on

> And Is there any Code documentation that I could possibly read and figure
> out about different functions?

For Layout, the most relevant documentation is in the header files under layout/ .
Feel free to ask in #developers or #layout if you have questions on the code.
Flags: needinfo?(mats)
Any update on this?
As you see this still a problem and e10 is still not available for most of the users I guess (at least for me it is deactivated because I have Add-ons installed...).
Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 3 duplicates.
:emilio, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

This works with the e10s dropdown now.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(emilio)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: