paste & input events.
gregtap opened this issue · 5 comments
gregtap commented
handlePaste is called to check against max length.
It would be handy to an action key-paste
event triggered.
Same for the input
event.
hectorh30 commented
Or maybe an on-paste
event
jfrux commented
// app/app.js
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import computed from '@ember/object/computed';
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
customEvents: {
paste: "paste"
}
});
loadInitializers(App, config.modulePrefix);
export default App;
$ ember g component inline-editor
// app/components/inline-editor.js
import ContentEditable from 'ember-content-editable/components/content-editable';
export default ContentEditable.extend({
paste(e) {
const text = (event.originalEvent || event).clipboardData.getData('text/plain');
e.preventDefault();
this.$().html(text);
}
});
st-h commented
@joshuairl I am a little unsure about the edit history of your post, but yes - I think we can add a hook for paste events to the 1.0.0 release of the addon.
jfrux commented
Sorry!
I basically converted my post into my explanation for future visitors on how it could be implemented in their app without the plugin being edited.
Just more of a reference.
…--
Joshua F. Rountree | UX Developer
The E.W. Scripps Company
312 Walnut Street, Suite 2800, Floor 29th, Office 29W109
Cincinnati, Ohio 45202-4024
(513) 977-3840 (office, M-F, 7a-4p)
(513) 827-7936 (mobile)
On Mar 15, 2018, 8:09 AM -0400, Steve ***@***.***>, wrote:
@joshuairl I am a little unsure about the edit history of your post, but yes - I think we can add a hook for paste events to the 1.0.0 release of the addon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
st-h commented
@joshuairl ah, thanks for the input. Added a paste hook to the 1.0.0 release.