Bug 261639 - datalist rendered in wrong location
Summary: datalist rendered in wrong location
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-16 11:30 PDT by Luke Warlow
Modified: 2023-09-23 11:31 PDT (History)
5 users (show)

See Also:


Attachments
Left aligned datalist element (15.52 KB, image/png)
2023-09-16 13:48 PDT, Luke Warlow
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Warlow 2023-09-16 11:30:17 PDT
Load https://jsfiddle.net/p8eh0oqn/

When clicking on the input the datalist loads on the far left of the screen rather than anchored to the input. This should be fixed.
Comment 1 Ahmad Saleem 2023-09-16 13:03:47 PDT
@Luke - can you attach screenshot of broken behaviour? For me, it is loading fine and anchored to drop-down field.
Comment 2 Luke Warlow 2023-09-16 13:48:07 PDT
Created attachment 467705 [details]
Left aligned datalist element
Comment 3 Ahmad Saleem 2023-09-16 13:50:53 PDT
@Luke - I am unable to reproduce this bug in Safari 16.6, Safari Technology Preview and WebKit ToT. :-(

For me, it is just below drop-down for me. Do you have any experimental flag enabled?

I am on macOS Ventura 13.5.2, you on also?
Comment 4 Luke Warlow 2023-09-16 13:54:41 PDT
I'm on macOS 13.5.1 and can reproduce on Safari 16.6 (18615.3.12.11.2) AND Tech Preview Release 177 (Safari 17.0, WebKit 18617.1.4.3)

No feature flags enabled (have reset both to defaults to make sure)
Comment 5 Ahmad Saleem 2023-09-16 13:57:49 PDT
OK, now I am able to reproduce.

1) Open drop-down
2) Move JSFiddle pane left right and notice that the drop-down is stuck.

If you just load and open drop-down, it will be just below 'input field' but if you move panes to make page resize then drop-down will be stuck similar to reference screenshot from Luke.

@Luke - thanks for your help.
Comment 6 Luke Warlow 2023-09-16 14:00:37 PDT
Ah so I've just done more testing and it's in fact stuck on the far left on the SCREEN not just the Safari window, and it only happens on one of my multiple monitors. If I put it on my right monitor it works correctly. On my left screen it is pinned to the far left of the screen.

So it's more complicated than I originally thought.
Comment 7 Aditya Keerthi 2023-09-16 15:32:04 PDT
If anyone else is interested in investigating this, `-[WKDataListSuggestionsController dropdownRectForElementRect:]` in `WebDataListSuggestionsDropdownMac.mm` is where the location is determined.
Comment 8 Radar WebKit Bug Importer 2023-09-23 11:31:13 PDT
<rdar://problem/115936923>