[web-php] master: Allow "/" when editing code (#1177)
| From: | Antoine Bluchet via GitHub | Date: | Wed, 04 Dec 2024 07:21:15 +0000 |
| Subject: | [web-php] master: Allow "/" when editing code (#1177) | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-32452@lists.php.net to get a copy of this message | ||
Author: Antoine Bluchet (soyuka)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2024-12-04T15:16:25+08:00
Commit: https://github.com/php/web-php/commit/543eab70a4aa940839c238fbcfef35ad288f22bc
Raw diff: https://github.com/php/web-php/commit/543eab70a4aa940839c238fbcfef35ad288f22bc.diff
Allow "/" when editing code (#1177)
Co-authored-by: Luffy <lufei@php.net>
Changed paths:
M js/search.js
Diff:
diff --git a/js/search.js b/js/search.js
index ec4ef8fb6c..1cc5447de9 100644
--- a/js/search.js
+++ b/js/search.js
@@ -294,6 +294,10 @@ const initSearchModal = () => {
// Open when / is pressed
document.addEventListener("keydown", (event) => {
+ if (event.target.contentEditable === "true") {
+ return;
+ }
+
if (event.key === "/") {
show();
event.preventDefault();