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 Elantra AD (2016-2020) Service Manual: Sunroof Deflector Repair procedures
Replacement
1.
Open the glass fully.
2.
Remove the mounting pins (C), from the frame (B), and then remove the deflector (A).
3.
To install, reverse the removal procedure. ...
Hyundai Elantra AD (2016-2020) Owners Manual: Fuel Filler Door
Opening the fuel filler door
The fuel filler door must be opened from inside the vehicle by pulling up the
fuel filler door release lever.
1. Turn the engine off. Locate the fuel filler door release lever on the floor
on the left side of the driver seat.
2. Pull up on the release lever.
...