Closed BigWillie closed 5 years ago
You mean like those 'Email address' and 'Password' fields in this animated gif? https://github.com/tjvantoll/nativescript-IQKeyboardManager#nativescript-iqkeyboardmanager-plugin .. I think that's the default behavior if a hint was added, no?
Wow! thanks for the quick reply :) Yes - exactly like those... it doesn't seem to work with TextView fields, but does work with TextField..
I would use TextField if it were multiline. Killer keyboard by the way - has solved so many problems for me :) thanks!
eg:
<TextView hint="Additional Information" v-model="additional_information" />
Does not show hint, but
<TextField hint="Additional Information" v-model="additional_information" />
does show the hint
Ah, hmm, good catch. Not sure I've ever tried that actually. But hang on, I have an idea.
Cool :) Thanks!
If you install version 1.5.0 now, you can use TextViewWithHint
like this.
The reason you need a special TextView patched by the plugin is because the internal library (IQKeyboardManager) uses its own extension of iOS' UITextView
called IQTextView
which the plugin now also extends when TextViewWithHint
is used. This adds support for a placeholder
property which I've wired to NativeScript's hint
property.
Amazing! thank you!!! đź‘Ť
@EddyVerbruggen sorry for the delay, only just got around to testing it as was having a mare of a time with webpack... in the end I just copied my files out into a new native script project...
I put the tag into my vue nativescript app - and any component which contains it fails to load. Unfortunately, the logs don't tell me why...
Did you register the tag? I didn’t have time to document that, but it’s extremely similar to https://github.com/EddyVerbruggen/nativescript-IQKeyboardManager#nativescript-w-vue-usage
Thanks. Yep - I added
Vue.registerElement("TextViewWithHint", () => require("nativescript-iqkeyboardmanager").TextViewWithHint)
(as an aside - there is a typo in the example provided - a space between the object's dot and method)
to my app.js (main.js) file, and it didn't work.
Edit
Problem was in how I was calling the tag:
This does NOT work <IQKeyboardManager:TextViewWithHint hint="Additional Information" v-model="additional_information" ref="additional_information" />
This works:
<TextViewWithHint hint="Additional Information" v-model="additional_information" ref="additional_information" />
No need for the IQKeyboardManager:
part of the tag in view land.
Thanks for this - this plugin is fantastic! :D Thank you for making it!
Ha, yeah, that IQKeyboardManager:
prefix is only for plain-{N} apps, not for Angular and Vue. Glad you figured that out! Will change the readme a little. đź‘Ť
is it possible to show the 'hint' in a textView toolbar?