The sunshade will open automatically with the sunroof when the glass panel moves. If you want it closed, move the sunshade manually.
NOTICE
The sunroof is made to slide together with the sunshade. Do not leave the sunshade closed while the sunroof is open.
Hyundai Sonata LF 2014-2019 Service Manual: Rear Door Window Glass Components and Components Location
Component Location
1. Rear door window glass
...
Hyundai Sonata LF 2014-2019 Service Manual: Roller Blind Repair procedures
Removal
1.
Open the roller blind using the panorama sunroof switch.
•
Leave 10 ~ 20cm (0.3937 ~ 0.7874 in) of the roller blind unopened.
2.
Remove the roof trim.
(Refer to Roof Trim - "Roof Trim Assembly")
3.
Remove the roller blind bar (C) by pressing th ...