Comments (16)
Heh, just read the documentation. Already implemented :P
from quickmockup.
Oh wait. Is this the "del" key on a Windows keyboard? This doesn't work with a Mac's delete key (which is also the backspace key).
from quickmockup.
Ah, interesting. Don't have a mac around at the moment. Do Mac users expect objects to delete on backspace? If yes, we could implement this – (FYI this is where the event binding magic happens and this is mousetrap, the library I used, just in case you want to give it a go)
from quickmockup.
the backspace button is called "delete" so I assume so :P.
I'll give it a go when I come back from dinner (or maybe tomorrow, but I definitely won't mind digging into the code for this).
from quickmockup.
TLDR; On (my) mac (/firefox) the backspace is also mapped to the browser's back function.
What should happen: delete the element
What happens instead: deletes the element and (wants to go back and) asks if I want to leave the page.
Solutions:
- prevent the default action (may make sense for these in general, also a windows user is unlikely to want to navigate away by backspace (if that key binding is existing there?)
- use other key
from quickmockup.
Out of curiousity, is this a binding you added yourself? My Firefox doesn't do that.
from quickmockup.
Hmm, did not change anything as far as I remember. Are there other Mac-People around who might enlighten us? (And does that keybinding exist in other browsers too?)
from quickmockup.
from quickmockup.
@paulproteus: Thanks! Thats a great thing to know.
I'm unsure of how to proceed – we could:
- Set up an alternative, unambigous delete key
- Your ideas...
from quickmockup.
Hmm, maybe I did a mapping?
Maybe just "d"?
Or we overwrite the behavior. Since it's a webapp that mimics drawing and design apps like Photoshop, Sketch, and Illustrator, I don't think using the "delete/back" key for this purpose is wrong. The question I guess is - are users expecting their browser to act as browsers, or are they expecting standard app functionality?
From that SE:
var hasfocus = 'false';
// when focus happens, set a variable
$(document).on('focusin','input, textarea',function() {
hasfocus = 'true';
});
// unset when focus is not happening
$(document).on('focusout','input, textarea',function() {
hasfocus = 'false';
});
// if not in a form field, stop backspace and delete default action
$(document).keypress(function (e) {
if(e.which == 8 || e.which == 46) {
if(hasfocus == 'false') {
e.preventDefault();
}
}
});
from quickmockup.
are users expecting their browser to act as browsers, or are they expecting standard app functionality?
Good question.
I just tried with yahoo mail, they use it as a delete key.
Though I agree with the stackexcange person saying that it is usually not a great idea to block the keys, we already break the behaviour with the "are you sure you want to leave" message, so remapping would not do too much additional harm but some additional good here.
- See some other webapps
- Is the above mentiones block-shortcut function possibly already part of the library we use, moustrap? Yes,seemingly it is. See the linked page, Headline: Stopping the default behavior
from quickmockup.
from quickmockup.
@asheesh, I think you need to inform the masses on GitHub that +1 implies you'll do something about it :P
from quickmockup.
check the most current version (the one on the demopage e.g.) and see if it works (it does for me).
from quickmockup.
Yep, that works for me!
Edit: Confirmed, both Chrome and Firefox
from quickmockup.
I close this optimistically. We can still reopen if virtual stuff explodes :)
from quickmockup.
Related Issues (20)
- official Docker image HOT 2
- Experiment with draw2D HOT 5
- v2: Add strokes to elements HOT 1
- v2: Add slight outline on elements that currently dragged elements would be grouped with HOT 5
- v2: extend inplace label editing with save/cancel buttons
- v2: Constraints/principle we should consider when creating functionality HOT 2
- v2: Duplicate elements easily via ctrl+D HOT 1
- v2: Have in-place toolbar HOT 1
- v2: Duplicated elements should be grouped with the container of the original elements parent
- Additional Widgets suggestion: charts HOT 1
- v2 visual representations of element in item collection bar. HOT 2
- v2 increase front size in on-canvas elements to 14px
- v2 keep element-cursor offset consistent when drop-adding elements to canvas HOT 1
- v2: Ease grouping elements HOT 4
- v2 code quality: Event initialization is messy, needs lots of files to be touched
- v2: represent element as soon as drag enters canvas HOT 3
- Cloning Window element is broken HOT 2
- Moving multiple selections into Container
- Elements being newly added are not grouped HOT 1
- Support images HOT 2
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 quickmockup.