# 關閉 ipad 在網頁上的 drag and drop 功能 ipad 在 ios11 之後,可以對連結做 drag and drop 的操作(被拖曳的連結如果拉到分頁欄,可以開啟新分頁;如果拖曳到輸入框,則會將連結網址填入)。  如果想要在網頁上關掉這個功能,可以將元件的 ondragstart event 綁定 false: ```javascript= @HostListener('dragstart') ondragstart() { return false; } ``` 或是在 css 中設定: ```css= -webkit-user-drag: none; ``` 附註: - `-webkit-user-select: none;` 可以關閉長按選擇 - `-webkit-touch-callout: none;` 可以關閉長按跳出"拷貝"等功能選單 參考資料: - https://developer.apple.com/library/archive/documentation/AppleApplications/Conceptual/SafariJSProgTopics/DragAndDrop.html#//apple_ref/doc/uid/30001233-177206 - https://stackoverflow.com/questions/33132175/disable-dragging-in-webview - https://stackoverflow.com/questions/46059925/how-to-disable-ios-11-dragging-within-the-whole-app
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up