Skip to content

iOS: TextView hint becomes text #3354

Closed

Description

@eleddie

I have a text view which has a hint, when I start typing, the hint disappears (as it should) and I type like normal text. But when I send the message (is a chat app) and set the ngModel var back to "" again, the hint now becomes editable text and I start typing in gray color like hint.

Here's the problem:

tv-err

Activity

  1. NickIliev commented on Dec 27, 2016

    @NickIliev
    Contributor

    Hi @eleddie

    I've tried to reproduce your case but to no avail! I've tested it with this sample (with some modifications) but still was not able to reproduce so perhaps you can share with us a code snippet or a sample project which can recreate this scenario.

  2. eleddie commented on Jan 4, 2017

    @eleddie
    Author

    I would like this issue to be reopened since it isn't fixed yet. I was o a vacation trip and I couldn't reply. I'm going to create a sample project today so you could try it.
    Thanks

  3. reopened this on Jan 4, 2017
  4. Daxito commented on Jan 4, 2017

    @Daxito

    I also used to have this issue, I fixed it by removing the hint!!!

  5. NickIliev commented on Jan 6, 2017

    @NickIliev
    Contributor

    @eleddie, @Daxito can you post a snippet or a link to sample project reproducing the described case?

  6. eleddie commented on Jan 6, 2017

    @eleddie
    Author

    Hello @NickIliev, sorry for the delay, I've been kinda busy.

    This is my html:

    <TextView col="0" hint="Type a message..." [(ngModel)]="typing" returnKeyType="done" class="background-write"></TextView>
    <Button col="1" text="&#xE163;" class="mi" (tap)="sendMessage(typing)"></Button>

    and ts:

     private sendMessage(message: string) {
           if (message == "") return;
           this.typing = "";
           var newMessage = new Message(message.trim());
           this.messages.push(newMessage);
    }

    As @Daxito said, I can't just remove the hint...

  7. NickIliev commented on Jan 6, 2017

    @NickIliev
    Contributor

    @eleddie I was able to reproduce your case and marked is as a bug. We will investigate further and post additional info when we have a solution.

    Code to reproduce this issue here

    Meanwhile as a workaround, you can reset your hint after the initial text value is send. This way you will still have initial hint.
    Example:

    import { Component } from "@angular/core";
    
    @Component({
        selector: "my-app",
        templateUrl: "app.component.html",
    })
    
    export class AppComponent {
        public typing: string = "";
        public hint: string = "Type a message... ";
    
        public sendMessage(message: string) {
            if (message == "") {
                return;
            }
            this.hint = "";
            this.typing  = "";
        }
    }
    
    <StackLayout class="p-20">
        <TextView #tv [(ngModel)]="typing" [hint]="hint" returnKeyType="done"></TextView>
        <Button text="TAP" class="mi" (tap)="sendMessage(tv.text)"></Button>
    </StackLayout>
    
  8. eleddie commented on Jan 6, 2017

    @eleddie
    Author

    Great! Thanks @NickIliev I'll be waiting for it to be fixed

  9. ickata commented on May 25, 2017

    @ickata

    Hi, any update here?

  10. tsonevn commented on May 26, 2017

    @tsonevn
    Contributor

    This is still reproducible with tns-core-modules 3.0 and @next .
    For now, you could use the workaround suggested by @NickIliev in its comment.

  11. 1 remaining item

  12. added this to the 3.1 milestone on May 26, 2017
  13. self-assigned this
    on May 30, 2017
  14. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    and removed on May 30, 2017
  15. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Jun 1, 2017
  16. removed their assignment
    on Jun 1, 2017
  17. SvetoslavTsenov commented on Jun 1, 2017

    @SvetoslavTsenov
    Contributor

    The fix is already available in tns-core-modules@next and will also be released with tns-core-modules@3.1.0

  18. lock commented on Aug 28, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  19. locked and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions