But it was also a program that went hilariously over budget. Nearly costing as much as the A380. It had a whole bunch of problems and still has problems today. Lots of production issues.
This had lead to a situation where they will need to sold literally 1500 or more planes to break even on the program. And 1500 is a gigantic amount of wide-bodies.
The 787 didn't really eat A380s lunch. Its more like 2 companies both thought about what the best investment would be for the future. Boeing picked the right plane. Airbus picked the wrong plane. The competitor to the A380 was the 747-8 and the 777.
Had Airbus not totally misread the market and invested in totally the wrong market. The Dreamliner could have backfired on Boeing. If Airbus had a 787 serious competitor out at the same time, the 787 might never have sold more then 1500 times. They already have total order of around 1800 and there are likely gone be many more because Airbus doesn't have a perfect competitor plane.
In the wide-body market, Boeing is still totally competitive with Airbus. Its the narrow body market where Airbus is kicking Boeing ass.