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
Fix #524, Fix #534 #535
base: main
Are you sure you want to change the base?
Fix #524, Fix #534 #535
Conversation
… this was breaking initialization when being rendered inside a cross-orgin iframe
…ult for s/+/- keys when input of textarea is in focus anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We appreciate your help on this! I am sorry I am not ready to give it a full thought currently but here are my quick notes on the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dist/
folder is updated only on new version releases (and corresponds to the version published in NPM) so I don't think we should edit files here manually in PRs.
@@ -2888,24 +2897,30 @@ Miew.prototype._onKeyDown = function (event) { | |||
} | |||
break; | |||
case 'S'.charCodeAt(0): | |||
event.preventDefault(); | |||
event.stopPropagation(); | |||
if (!['TEXTAREA', 'INPUT'].includes(document.activeElement?.tagName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there are other tag names to support. Or even there could be an arbitrary DIV element (a React component) waiting for the S key and this solution wouldn't help. This fix might be a short-term solution if miew.enableHotKeys(false)
doesn't work for you.
The long-term solution I see is:
- move all key handlers to the demo apps providing proper public methods in the library;
- disable the
S
key completely as it looks more like a debugging key;
However, it is just my quick glance with a dump of current thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a random file has arrived from a MacOS. We'd better put the name into .gitignore
.
@@ -23,6 +23,6 @@ | |||
}, | |||
"packageManager": "yarn@3.6.3", | |||
"resolutions": { | |||
"nomnom": "^1.8.1" | |||
"nomnom": "^1.8.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An irrelevant change but a good catch nevertheless.
Description
This pull request addresses issues #524 and #534:
Should be reviewed by someone more familiar with the codebase to make sure there's no unintended consequences.
Type of changes
Checklist
yarn run ci
: lint and tests pass locally with my changes.