Comments (17)
@GabrielStetco You're right, but IMO that's not really up to this plugin. It would be cool to have a browser version but it's not where my expertise is. Also, if it wouldn't suck I would undermine the usefulness of this plugin in a way 😉
from cordova-plugin-native-keyboard.
Can you share the code snippet with me?
from cordova-plugin-native-keyboard.
Here you go:
NativeKeyboard.showMessenger({
animated: true,
// type: 'default', // Options are:
"default", "decimalpad", "phonepad", "numberpad",
"namephonepad", "number", "email", "twitter",
"url", "alphabet", "search", "ascii"
placeholder: 'Type your message..',
placeholderColor: '#DDDDDD',
textViewBackgroundColor: '#F6F6F6',
backgroundColor: '#F6F6F6', // Appears to be Android only
textViewBorderColor: '#777777', // iOS only
textColor: '#555555', // Appears to be Android only
autocorrectionEnabled: false, // on iOS
this hides the 'predictive text' bar
appearance: 'light', // iOS only, light (default) | dark
// autoscrollElement:
'DLG1.R1.PANEL.1.PANEL.1.PANEL.0.BODY.CONTENTWRAPPER.SCROLLWRAPPER',
onSubmit: function(text) {
SendMessage(text);
},
onKeyboardDidShow: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidShow');
},
onKeyboardDidHide: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidHide');
},
leftButton: {
type: 'ionicon', // or 'text' (Android
only currently) or 'fontawesome'
value: '\uf48a', // http://ionicons.com/
- right-click and inspect the :before value (don't forget the \uf !)
//color: '#ff0000', // default blue on iOS, grey on Android
textStyle: 'normal', // if type is
'text', you can set this to 'normal' (default), 'bold', 'italic'
disabledWhenTextEntered: false, // default false
onPress: function () {
if (window.plugins && window.plugins.actionsheet) {
window.plugins.actionsheet.show({
androidTheme:
window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT,
buttonLabels:
['Take Photo or Video', 'Use Last Photo Taken', 'Choose From Library'],
addCancelButtonWithLabel: 'Cancel'
}, function(index) {
if (index == 1)
{dialog.object}.runAction('TakePicture');
if (index == 3)
{dialog.object}.runAction('SelectPicture');
});
}
else
{
// alert("Left
button pressed - if you install
cordova-plugin-actionsheet you'll see a nice ActionSheet in this demo.");
}
}
},
rightButton: { // necessary for Android only
type: 'text', // or 'fontawesome' or 'ionicon', default 'text'
value: 'Send', //
'fa-battery-quarter', // '\uf2c3', // 'Send', // default 'Send'
textStyle: 'bold', // 'normal' (default), 'bold', 'italic'
//color: '#FF0000', // default iOS blue
onPress: function () {
// alert("Right button was
pressed - text was passed to 'onSubmit' if provided.");
}
}
});
At 11:48 PM 11/17/2016, you wrote:
Can you share the code snippet with me?
You are receiving this because you authored the thread.
Reply to this email directly,
#7 (comment)
it on GitHub, or
https://github.com/notifications/unsubscribe-auth/AEX-mx8rbBOI1p838cgItn-tSb9OHyqaks5q_VhLgaJpZM4K0qENmute
the thread.
from cordova-plugin-native-keyboard.
(copied the code above into a new reply as GitHub doesn't support Markdown in email replies:)
NativeKeyboard.showMessenger({
animated: true,
// type: 'default', // Options are: "default", "decimalpad", "phonepad", "numberpad", "namephonepad", "number", "email", "twitter", "url", "alphabet", "search", "ascii"
placeholder: 'Type your message..',
placeholderColor: '#DDDDDD',
textViewBackgroundColor: '#F6F6F6',
backgroundColor: '#F6F6F6', // Appears to be Android only
textViewBorderColor: '#777777', // iOS only
textColor: '#555555', // Appears to be Android only
autocorrectionEnabled: false, // on iOS this hides the 'predictive text' bar
appearance: 'light', // iOS only, light (default) | dark
// autoscrollElement: 'DLG1.R1.PANEL.1.PANEL.1.PANEL.0.BODY.CONTENTWRAPPER.SCROLLWRAPPER',
onSubmit: function(text) {
SendMessage(text);
},
onKeyboardDidShow: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidShow');
},
onKeyboardDidHide: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidHide');
},
leftButton: {
type: 'ionicon', // or 'text' (Android only currently) or 'fontawesome'
value: '\uf48a', // http://ionicons.com/ - right-click and inspect the :before value (don't forget the \uf !)
//color: '#ff0000', // default blue on iOS, grey on Android
textStyle: 'normal', // if type is 'text', you can set this to 'normal' (default), 'bold', 'italic'
disabledWhenTextEntered: false, // default false
onPress: function () {
if (window.plugins && window.plugins.actionsheet) {
window.plugins.actionsheet.show({
androidTheme:
window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT,
buttonLabels:
['Take Photo or Video', 'Use Last Photo Taken', 'Choose From Library'],
addCancelButtonWithLabel: 'Cancel'
}, function(index) {
if (index == 1)
{dialog.object}.runAction('TakePicture');
if (index == 3)
{dialog.object}.runAction('SelectPicture');
});
}
else
{
// alert("Left button pressed - if you install cordova-plugin-actionsheet you'll see a nice ActionSheet in this demo.");
}
}
},
rightButton: { // necessary for Android only
type: 'text', // or 'fontawesome' or 'ionicon', default 'text'
value: 'Send', // 'fa-battery-quarter', // '\uf2c3', // 'Send', // default 'Send'
textStyle: 'bold', // 'normal' (default), 'bold', 'italic'
//color: '#FF0000', // default iOS blue
onPress: function () {
// alert("Right button was pressed - text was passed to 'onSubmit' if provided.");
}
}
});
from cordova-plugin-native-keyboard.
Hmm, narrowed it down to the maxChars
property: if you add it you will get the placeholder to appear. There's 2 options to fix this:
- Add
maxChars: 0
, or - Update to 1.1.1
from cordova-plugin-native-keyboard.
Great! Thanks so much!
At 05:30 AM 11/18/2016, you wrote:
Hmm, narrowed it down to the maxChars property:
if you add it you will get the placeholder to
appear. There's 2 options to fix this:
- Add maxChars: 0, or
- Update to 1.1.1
You are receiving this because you authored the thread.
Reply to this email directly,
#7 (comment)
it on GitHub, or
https://github.com/notifications/unsubscribe-auth/AEX-m5Ha_NK9UHcoLz_4NcqyXCIuTrS7ks5q_ah8gaJpZM4K0qENmute
the thread.
from cordova-plugin-native-keyboard.
from cordova-plugin-native-keyboard.
+1
This plugin is really useful.
I have already implemented something similar in my current project, but this is better.
The problem is that if I start using it I cannot modify it on my own and I'm not sure that Eddy can dedicate additional time and continuity to this project.
I see that he's also busy on other projects.
Gabriel
from cordova-plugin-native-keyboard.
@DaveRand Let me look into that this weekend.
@GabrielStetco That's the exact reason this is a commercial plugin. If it would be free I would not be able to spend any time on it (and would have never created it in the first place). Thanks for considering using it!
from cordova-plugin-native-keyboard.
I completely agree, free work does not put food on the table :)
The reality is that I'd gladly pay for this addition.
Is just that I sent you more than a week ago an email regarding any possible implementation for browser support. Not received any answer I assumed you were busy.
I appreciate your work
Gabriel
from cordova-plugin-native-keyboard.
from cordova-plugin-native-keyboard.
Hey @DaveRand you can now pass in a onTextEntered
event listener function. Update to 1.1.3 and see the readme.
from cordova-plugin-native-keyboard.
from cordova-plugin-native-keyboard.
from cordova-plugin-native-keyboard.
Hey @DaveRand, I could change the native implementation to only send text to JS when something is in there, but I'd also like to handle the case where the user deleted everything (backspace event).
I'm not sure what your usecase is, but can you just check what is returned and act upon that?
from cordova-plugin-native-keyboard.
from cordova-plugin-native-keyboard.
Sounds like a nice feature!
I'll see if it can be cleaned up a bit, but perhaps you can indeed show the indicator (gif) as long as the onTextUpdated
function returns anything but an empty string.
from cordova-plugin-native-keyboard.
Related Issues (20)
- Android 7.1.x doesn't install
- <input data-nativekeyboard="true" type="text" /> not working HOT 1
- What part of the React lifecycle is the best place to run the code to show the keyboard? HOT 3
- I appear to be able to pull a div away from the keyboard when in simulator mode HOT 1
- Textinput disappears when using "secure: true" HOT 2
- invalid license on iOS 13 HOT 1
- Wrong Default Font when building with Xcode 11 HOT 3
- Scroll child wrapper onKeyboardWillShow
- onKeyboardWillHide is not fired
- Apple compliance - ITMS-90809 UIWebView HOT 4
- Native keyboard accessory bar buttons callback
- Font Awesome setting crashes app HOT 4
- Disable WebView Resizing (Not in Messenger) HOT 1
- Keyboard Defaults to Capitalize on Type email and password HOT 2
- Update Swift UIReturnKeyType List Link in Demo
- Long term support HOT 1
- Dead mans switch for source code HOT 1
- Error using it with Capacitor HOT 3
- Question: can we use native keyboard as simple keyboard, with shrink view animation HOT 7
- Keyboard event not working on android 10 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 cordova-plugin-native-keyboard.