-
Notifications
You must be signed in to change notification settings - Fork 161
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
In safari browser does not support Chinese input #221
Comments
Please provide a minimal reproduction. Thanks. |
2024-03-05.18.20.14.movyou can check this vide.This problem also appears in the official example.thanks a lot. |
@wallace-yang Sorry I cannot reproduce myself. What's your environment (macOS version, Safari version, Chinese input method etc.)? CleanShot.2024-03-06.at.10.30.04.mp4 |
allCellsArr.forEach(({ pos }, index) => {
decorations.push(
Decoration.widget(pos + 1, () => {
const grip = document.createElement("span");
grip.style = "display: block;line-height:0px;";
grip.innerHTML = "​";
return grip;
})
);
}); But it raises new questions like this: 2024-03-06.10.40.08.movFeishu(click me see example), the largest rich text editor product in China, uses this solution, and they disable the entry of any characters after selecting a table cell, so this problem does not arise.I would also like to disable input after cell selection, but disabling is not 100% effective.This is my code. new Plugin({
props: {
handleDOMEvents: {
keydown (view, event) {
console.log("🚀 ~ keydown ~ event:", event);
if (hadSelectedCell(view) && ((event.keyCode >= 65 && event.keyCode <= 90) || event.keyCode === 229)) {
console.log("🚀 ~ keydown ~ hadSelectedCell,disable!!!!!!", event);
event.preventDefault();
return true;
}
}
}
}
}) The Chinese input method is sometimes disabled and sometimes invalid, but it is effective in the English state.The result like this: 2024-03-06.10.55.01.movIf you want my device info, the following two pictures are my device information. Expect your reply, thank you. |
CleanShot.2024-03-16.at.22.03.20.mp4I can reproduce this bug. This bug only occurs inside an empty table cell. After some debugging, I found that Safari produces different It seems that there is already some code in the prosemirror-view package that patches the table behavior in Safari (code link). Maybe it's possible to add some more code in the prosemirror-view to workaround this. However, I don't understand how to do that sadlly. I did find another workaround during debugging. It seems that once I remove the |
@ocavue Thank you very much for your valuable information. If I have other solutions in the future, I will reply here. |
I'm also troubled by this problem,
Resizing cell and IME inputing will not happen at the same time. If toggling position property value on |
@ocavue Hi! I have resolve this issue😊 |
It seems that this Safari bug not only affect prosemirror-tables, so I created a standalone package prosemirror-safari-ime-span to address this issue. Could you try https://ocavue-fix-safari--prosemirror-tables.netlify.app/ and see if everything works fine? |
When I select a cell, move the mouse to an empty cell, and then input Chinese characters, a bug will occur.Some letters that should have been displayed are missing. 2024-07-05.17.46.01.mov |
Sorry for the late reply.
I'm unable to reproduce this with my Safari Version 17.5 (19618.2.12.11.6). What's your Safari version. Although I cannot reproduce, I pushed a patch that reduces the state update when the IME is enabled or disabled. Could you try https://ocavue-fix-safari--prosemirror-tables.netlify.app/ again and see if this issue still occurs? |
This issue still occurs,However, bugs occur randomly, not necessarily every time, with a probability of about 30%. 2024-07-19.16.46.32.movmy Safari Version 17.4 (19618.1.15.11.12) |
Could you check if you can reproduce this bug using Safari Technology Preview v18.0+? I cannot reproduce after many tries using Safari Version 17.5 and Safari Technology Preview 18.0, so I suspect that it's a bug in 17.4 that has been fixed. |
I have already downloaded and used Safari Technology Preview, but the issue still persists. Additionally, the problem occurs even when the target cell is not empty. Here are my Safari Technology Preview and device information. 2024-07-23.11.08.47.mov |
A number of exception bugs occur, such as exceptions for new columns and input results
The text was updated successfully, but these errors were encountered: