Comments (4)
How should this work, exactly? Have a start element and end element, selecting text between the two?
from syn.
Yes, but also support drag's current API of coordinates. I'm not yet sure if we should allow starting from a specific point in text as well, eg: "see spot run", start selection from "spot".
from syn.
So it looks like the current API for Syn.drag is:
Syn.drag(options, from, callback)
Would it make sense to have this be part of Syn.drag or should there be a Syn.select?
// Using selectors
Syn.select(startElement, endElement, callback);
Syn.select('#startel', '#endel', callback)
// Using coordinates
Syn.select(options, callback);
Syn.select({ fromX: 100, fromY: 100, toX: 200: toY: 200 }, callback);
Or am I way off?
from syn.
Just to clarify, "drag" is a specific event type in browsers, and drag events are not actually fired for text selection. I suppose we could check the target element and see if it is draggable, and if it isn't, have this do a selection.
Thoughts on this? Thanks!
from syn.
Related Issues (20)
- Version inconsistency? HOT 2
- Uncaught error when run in browser extension
- An in-range update of steal is breaking the build 🚨 HOT 2
- An in-range update of jshint is breaking the build 🚨 HOT 2
- An in-range update of steal-tools is breaking the build 🚨 HOT 4
- Add the “key” property to events HOT 1
- inconsistent syn downloads from github
- Syn 1.0
- Syn 1.0 - ESLint
- Syn 1.0 - Publish 1.0.0-pre.0 HOT 1
- Syn 1.0 - CI passing
- Syn 1.0 - Make sure it works in all browsers again HOT 1
- Syn 1.0 - Mocha & webpack setup
- Syn 1.0 - Jest setup
- Syn 1.0 - Finish API documentation
- Syn 1.0 - ESM build
- keyCode is not mapped correctly when capital character is given
- Syn::focus() dispatch some unwanted events, it closes popup HOT 1
- `syn.type()` with `[escape]` string does press escape, but also appends `escape` text HOT 1
- `syn.type()` with `[end]` does not support `input` tag
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 syn.