Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy+pasting horizontally overflowing text in Safari creates vertical overflow #1294

Open
SangJunBak opened this issue Nov 8, 2023 · 2 comments

Comments

@SangJunBak
Copy link

Describe the issue

Video:

Screen.Recording.2023-11-08.at.1.49.53.PM.mov

Steps to reproduce:

  1. Make sure you have a mouse plugged in
  2. Go to Safari
  3. Make sure the height of the container is the height of the content inside (in the share link, set height from 100vh to auto)
  4. Make sure we don't add the basicSetup extension (for some reason if this is added, the issue doesn't occur)
  5. Copy and paste a super long string (dasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsaddasdsadd used in the example)

Browser and platform

Safari Version 17.1 (18616.2.9.11.9, 18616)

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJjb25zb2xlLmxvZygnaGVsbG8nKVxuIiwKICBleHRlbnNpb25zOiBbamF2YXNjcmlwdCgpXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK

@SangJunBak
Copy link
Author

I created a workaround for the time being which involves inputting and deleting text at the beginning via a custom view plugin.

function safariCopyPasteHackExtension(): Extension {
  const viewPlugin = ViewPlugin.define((view) => {
    return {
      update: (viewUpdate) => {
        console.debug(viewUpdate);
        for (const transaction of viewUpdate.transactions) {
          if (transaction.isUserEvent("input.paste")) {

            setTimeout(() => {
              const addSpaceAtBeginning = { from: 0, insert: " " };
              const removeSpaceAtBeginning = { from: 0, to: 1 };

              view.dispatch({ changes: addSpaceAtBeginning });
              view.dispatch({ changes: removeSpaceAtBeginning });
            }, 500);
          }
        }
      },
    };
  });

  return viewPlugin;
}

@marijnh
Copy link
Member

marijnh commented Nov 24, 2023

I am not managing to reproduce this. Could you link a /try example that sets everything up properly for this to occur? This is what I tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants