Bug 261639

Summary: datalist rendered in wrong location
Product: WebKit Reporter: Luke Warlow <lwarlow>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, akeerthi, cdumez, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Left aligned datalist element none

Luke Warlow
Reported 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.
Attachments
Left aligned datalist element (15.52 KB, image/png)
2023-09-16 13:48 PDT, Luke Warlow
no flags
Ahmad Saleem
Comment 1 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.
Luke Warlow
Comment 2 2023-09-16 13:48:07 PDT
Created attachment 467705 [details] Left aligned datalist element
Ahmad Saleem
Comment 3 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?
Luke Warlow
Comment 4 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)
Ahmad Saleem
Comment 5 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.
Luke Warlow
Comment 6 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.
Aditya Keerthi
Comment 7 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.
Radar WebKit Bug Importer
Comment 8 2023-09-23 11:31:13 PDT
Note You need to log in before you can comment on or make changes to this bug.