I usually make modal position:fixed and use JavaScript to position them in the center or wherever. Same for drop-down menu’s when you click a button.
Also doesn't this mean you have to listen for scroll events this way and update the XY coordinates for things like dropdowns?
Also drop downs are "attached" to some element in the UI, and you probably want those menus to scroll with the page