toeverything / blocksuite

🧩 Content editing tech stack for the web - BlockSuite is a toolkit for building editors and collaborative applications.
https://blocksuite.io
Mozilla Public License 2.0
4.5k stars 415 forks source link

[Edgeless mode] [Bug] Cmd-Z in Safari when editing text opens previously closed tab #8725

Open OkciD opened 2 days ago

OkciD commented 2 days ago

Hello! Found a bug in edgeless mode

Steps to reproduce:

  1. Open Safari
  2. In tab A open https://try-blocksuite.vercel.app/starter/?init&mode=edgeless
  3. Open new tab B and navigate to some site (e.g. google.com)
  4. Close tab B
  5. In tab A put a shape and inut some text in it
  6. Press Cmd-Z

Actual behaviour:

Expected behaviour:

OkciD commented 2 days ago

It seems like e.preventDefault() is needed here https://github.com/toeverything/blocksuite/blob/5fcbbbdcbd2afc34c40eb3c0702ef965efafeaf3/packages/affine/components/src/rich-text/rich-text.ts#L304, but i'm not sure :)