-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextEditView neither shows placeholder nor the text after losing focus #69
Comments
What version of devkit-core are you using? This sounds like an issue fixed in play-co/devkit-core@6276051 (Oct 14) which should be in 4.0.2 and above. |
I am on 4.0.2 itself but still facing this. |
That's unfortunate. Perhaps it is a different issue. If you put together a minimal Application.js file that demonstrates the issue I'll have a look at it. |
Here it is.. import ui.TextEditView as TextEditView;
exports = Class(GC.Application, function () {
this.initUI = function () {
var textEditView = new TextEditView({
superview: this.view,
x: 20,
y: 10,
backgroundColor: "#FFF",
width: 280,
height: 80,
color: "#000",
hintColor: "red",
hint: "Hello World...!"
});
};
this.launchUI = function () {
};
}); And here are few more details:
Thanks. |
I was way off - the commit I linked above is for prompts, not edit fields. I've definitely confirmed the issues on android, and I've run into some additional ones in the simulator as well (did not test ios). It looks like the browser textedit logic has an issue placing the text when editing. Android Summary
Note - it seems like losing focus directly makes the text hide incorrectly. However, losing focus from a different overlay (the keyboard or the copy/paste overlay) does NOT hide the text. Simulator (using the above code but with the background set to blue to make it easier to see).
|
Thanks @collingreen for confirming. |
@collingreen , This has now become a blocker for me. Could you please give me some pointers so that even I could look into this and send out a PR if possible. |
@jsdevlover I haven't dealt with that code before so I don't have any specific advice aside from that initial checklist of things that look wrong. I also didn't look at the ios version to see if it has similar problems. I understand your goal of entering text in a form - we have used input prompts for simple text input / registration forms before with good success, so it isn't an unreasonable suggestion if you just want something that is already working that accepts user input. Otherwise, you'll have to either look into whatever is causing the issues here or roll your own input box. |
@collingreen , Here are my findings for text disappearing on losing focus.
While I debugged I could find that on losing focus But I found a workaround - wrapping the Hope this helps. |
@jsdevlover I'm beginning to suspect that this is a different problem than the one we originally assumed. Your example code exhibits the broken behavior above, but I can fix all of the android problems (keyboard on first click, cursor in wrong spot, text disappears when clicking away) by simply replacing the the 3 character color hex codes with 6 character hex codes or color names. import ui.TextEditView as TextEditView;
exports = Class(GC.Application, function () {
this.initUI = function () {
this.view.style.backgroundColor = 'blue';
//Startup.start();
var textEditView = new TextEditView({
superview: this.view,
x: 20,
y: 10,
// backgroundColor: "#FFF",
backgroundColor: "#FFFFFF",
width: 280,
height: 80,
// color: "#000",
color: "#000000",
hintColor: "red",
hint: "Hello World...!"
});
};
this.launchUI = function () {};
}); Does this same thing fix it on your end using the latest devkit-core tag? |
Yes. It does. Thanks. |
For native environment (Android),
TextEditView
doesn't show the placeholder text unless it is focused. Also, after entering some text in theTextEditView
it disappears after view loses focus.The text was updated successfully, but these errors were encountered: