Quantum-Game / quantum-game-2

LEGACY open-source version of Quantum Game 2 (Sept 2019 - Oct 2020)
https://quantumgame.io
MIT License
65 stars 16 forks source link

Prevent tooltip reuse #180

Closed JStrebeyko closed 4 years ago

JStrebeyko commented 4 years ago

Problem

Closing a tooltip in one level made it close it in all the others. The behavior was caused by Vue reusing the component across boards, so having one state per each iteration number.

Solution

Distinct the tooltips across levels by including the level id into their :key attribute. This way we make Vue acknowledge these are separate instances, each deserving its own state.