Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Cannot focus on input element inside iframe when the editor has focus. #167

Closed
@tomoam

Description

@tomoam

Describe the problem

Cannot focus oninput element insideiframe when the editor has focus.

focus_issue_480p.mov

This is probably related to#161.
I suppose the intent of#161 is to considerpointerdown event as a human operation. However, events that occur insideiframe cannot be handled from outsideiframe.

<svelte:window
on:pointerdown={(e)=> {
if (!container.contains(/**@type{HTMLElement}*/ (e.target))) {
preserve_focus=false;
}
}}
/>

on:focusout={()=> {
if (preserve_focus) {
setTimeout(()=> {
instance?.editor.focus();
},0);
}
}}

Describe the proposed solution

whenbody element insideiframe gets focus, set focus on the editor. (usingpostMessage)

https://github.com/tomoam/learn.svelte.dev/blob/e291cb8c0d08f011d358427f7990fe7f2e6257d3/content/tutorial/common/src/__client.js#L93-L106

https://github.com/tomoam/learn.svelte.dev/blob/e291cb8c0d08f011d358427f7990fe7f2e6257d3/src/routes/tutorial/%5Bslug%5D/Editor.svelte#L236-L242

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp