For those who are interested:I managed to get it to work with the help of someone in Stack overflow and here is the answer:Keep everything as is but just change "transition : flex 500ms" to " transition all 500ms" and it will be fine.One more thing though, if you use seconds like "0.5s" instead of milliseconds like "500ms" it will not work neither even tough it worked before. It has to be "all" instead of "flex" and "ms" instead of "s".Hope it brought something to the community even though it's very specific.