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

simple editor edit cause popup error(IOS18 and chrome browser) #126

Open
oeyoews opened this issue Oct 5, 2024 · 18 comments
Open

simple editor edit cause popup error(IOS18 and chrome browser) #126

oeyoews opened this issue Oct 5, 2024 · 18 comments

Comments

@oeyoews
Copy link
Owner

oeyoews commented Oct 5, 2024

No description provided.

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 9, 2024

IMG_2485

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

ScreenRecording_10-14-2024.08-13-49_1.mp4

@oeyoews oeyoews changed the title ios 简单编辑器聚焦报错 simple editor edit cause popup error(Ios18 ) Oct 14, 2024
@Jermolene
Copy link

Hi @oeyoews I'm running iOS 18. Is there a convenient to reproduce the bug?

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

Hi @oeyoews I'm running iOS 18. Is there a convenient to reproduce the bug?您好,我运行的是 iOS 18。有方便的方法重现该错误吗?

I think the video above should be enough, let me add a text version of the reproduction steps later

@Jermolene
Copy link

Ah, I see the URL in the video now. I tried it on tiddlywiki.com with iOS 18 on my iPhone, and didn't encounter the same issue.

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

  1. open https://tiddlywiki.com/ on mobile(IOS 18 with chrome or firefox)
  2. create a new tiddler
  3. and try focus textarea

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

Ah, I see the URL in the video now. I tried it on tiddlywiki.com with iOS 18 on my iPhone, and didn't encounter the same issue.啊,我现在看到视频里的网址了。我在 tiddlywiki.com 上用 iPhone 上的 iOS 18 进行了尝试,没有遇到同样的问题。

Looks weird

@Jermolene
Copy link

Do you have any extensions running that could be interfering with things?

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

Do you have any extensions running that could be interfering with things?

try use chrome browser on moblie

@oeyoews oeyoews changed the title simple editor edit cause popup error(Ios18 ) simple editor edit cause popup error(IOS18 and chrome browser) Oct 14, 2024
@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

safari is normal

@Jermolene
Copy link

Hi @oeyoews I was able to remote debug iOS Chrome and reproduce the problem. It would be easier to work with a custom build that disabled the global error handler, but even without that we can see that the crash is occurring in the user scripts that Chrome adds to every page:

image

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

chrome and firefox is also not work, but safari, edge and opera is normal

@Jermolene
Copy link

Hi @oeyoews here's where things go wrong. The variable "t" is an Event object, but it doesn't have members "clientX" and "clientY". It's hard to see how there's anything very much TW can be doing that's causing the problem here, it really feels like a problem with Chrome's user script

Screenshot 2024-10-14 at 12 27 02

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 14, 2024

It looks like some bugs are caused by zooming in on the page when it is in focus. Since I don't have a computer at hand right now, I found a few previous versions of wikis on tiddlyhot and tested them, as well as the tiddlywiki starter kit. This further confirmed my initial guess that when editing text, if the page is zoomed in, this error pop-up will appear @Jermolene

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 15, 2024

Another test is to send the current web page to the home screen. Repeat the steps to reproduce, and the error disappears. It seems that in this case the web page no longer depends on the Chrome browser.

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 15, 2024

https://github.com/TiddlyWiki/TiddlyWiki5/compare/v5.1.23..v5.2.0

tw version archive By testing different tw versions, I found that there was no such error in versions before v5.2.0. It seems that the relevant code has changed, such as factory.js @Jermolene

@Jermolene
Copy link

Hi @oeyoews I'm pretty sure that the problem is that factory.js is creating synthetic "click" events that lack "clientX" and "clientY" properties. I have tried hacking handleKeydownEvent() to make it construct a proper MouseEvent, but it doesn't appear to help:

if($tw.keyboardManager.checkKeyDescriptors(event,keyInfoArray)) {
	var clickEvent = new MouseEvent("click", {
		bubbles: true,
		cancelable: true,
		view: window,
		clientX: 0,
		clientY: 0
	});
	console.log("Dispatching synthetic event",clickEvent)
	el.dispatchEvent(clickEvent);
	event.preventDefault();
	event.stopPropagation();
	return true;
}

I suspect that the problem actually occurs when an event is cloned in cloneEvent().

@oeyoews
Copy link
Owner Author

oeyoews commented Oct 15, 2024

251f32d532a82f02e6e9fef09ba9136
for cloneEvent method , clientX, clientY is include

@oeyoews oeyoews pinned this issue Oct 17, 2024
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