Comments (6)
I'm not opposed but let's think this through.
The current behavior:
- When the focus is in the editor, pressing
Delete
removes the next character in front of the cursor (vs. Backspace, which removes the character behind the cursor. - When the focus is on the filename in the sidebar, pressing
Delete
does not do anything. - If I click somewhere in the sidebar, I can delete the currently-opened file through keyboard controls by
Tab
bing to the dropdown menu for that file and selecting the "Delete" item. - If I want to delete a file which is not currently open that's lot bit trickier. I
Tab
to that file name and hitEnter
-- this opens the file and moves the focus to the text of the file in the editor. Which is good, but once the focus is in the editor I cannot figure out how to get the focus out of the editor using the keyboard alone. I have to click in the sidebar and then use the previous steps.
also we can update the shortcut instruction.
I wouldn't put it there because those are global shortcuts, but this is only if the file is selected.
from p5.js-web-editor.
@Swarnendu0123 @lindapaiste any update on this or should i start working on this?
from p5.js-web-editor.
Well @praveen-rikhari,
When the focus is in the editor, pressing Delete removes the next character in front of the cursor (vs. Backspace, which removes the character behind the cursor.
When the focus is on the filename in the sidebar, pressing Delete does not do anything.
If I click somewhere in the sidebar, I can delete the currently-opened file through keyboard controls by Tabbing to the dropdown menu for that file and selecting the "Delete" item
We have already figured out this part.
If I want to delete a file which is not currently open that's lot bit trickier. I Tab to that file name and hit Enter -- this opens the file and moves the focus to the text of the file in the editor. Which is good, but once the focus is in the editor I cannot figure out how to get the focus out of the editor using the keyboard alone. I have to click in the sidebar and then use the previous steps.
But, in this part I feel we need a clear approach. Can you please share, how you are going to implement that, maybe we could come up with a better solution. Though, I have one approach for this:
https://youtu.be/3ucnmBSp1xQ?si=whXQURv2e4uva46J
from p5.js-web-editor.
@Swarnendu0123 Yes, I have come up with an idea which looks like this :
- We nee to detect when the user presses the delete key which can be done by adding an event listener for the
keydown
event. - But before triggering the delete action, we will need to check if a file is currently selected in the sidebar.
- Then we can add a alert box for confirmation.
- If the user confirms the deletion, we can proceed with the deletion action.
I think this approach will work. So what's your take on this?
from p5.js-web-editor.
Yes @praveen-rikhari! I have also came up with a similar solution, and already created the PR.
from p5.js-web-editor.
Awesome @Swarnendu0123 thanks i will take a look at the code
from p5.js-web-editor.
Related Issues (20)
- Centralising breakpoints HOT 2
- Streamlining Navigation for My Sketches, Collections, and Assets. HOT 1
- Issue with negative values in SASS with `math.div` HOT 9
- Proper commenting `class selectors`
- Converting Editor/index.js into a functional component HOT 3
- Addition of Keyboard Shortcuts for Various Editor Functions. HOT 1
- Passport handles expected errors as exceptions HOT 1
- Logged out error modal pops up when downloading another user's sketch HOT 1
- Can't download the programs HOT 1
- Add cookies to allow user to stay signed in across browser sessions HOT 3
- Apply user's system color-scheme preference as the default site theme HOT 2
- Image not working HOT 5
- Linux highlight clipboards does not work HOT 1
- Hilighted brace style or cusor enhansment for improved visibility HOT 1
- Enable `.mtl` File Uploads HOT 1
- "Failed to Fetch" errors for images on web editor HOT 5
- Adding Multilingual README for the repo HOT 1
- webcam capture fails in editor on firefox android HOT 1
- kj HOT 2
- Increasing Web-Editor Keyboard Accessibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5.js-web-editor.