Skip to content

Conversation

@dmiedema
Copy link

There's still some bugs with the caret when there is no text which is kinda interesting

untitled

@gmertk
Copy link
Owner

gmertk commented Jul 21, 2015

I see the problem with the cursor here.

When there is no text, placeholder is taking its place. This moves to cursor to the beginning as in a default UITextField.

I am not sure if there is a way to move the cursor in the placeholder. I am on it...

@dmiedema
Copy link
Author

👍 I'll update the conflicts in the mean time

@gmertk
Copy link
Owner

gmertk commented Jul 21, 2015

I still couldn't find a way to move the cursor to the end when there is no text.

One way seems to set the textAligment to .Right temporarily. It moves the cursor to the right, but it also changes the alignment as the name suggests.

Will think about this...

@vicc
Copy link

vicc commented Sep 29, 2015

How about something like:

- (UITextPosition *)closestPositionToPoint:(CGPoint)point{
    if (!parkedTextAtEnd && text.length == 0) {
        UITextPosition *trueBeginning = self.beginningOfDocument;
        UITextPosition *betterBeginning = [self positionFromPosition:trueBeginning offset:parkedText.length];
        return betterBeginning;
    }
}

Note: I haven't tried it being that the project won't compile for me.

@katoree
Copy link

katoree commented Feb 3, 2016

Has there been any update on this? Was trying to figure out the caret issue but no luck yet. Very interested in getting this to work with the preceding text

@dmiedema
Copy link
Author

dmiedema commented Feb 3, 2016

Nope 😞 unfortunately i got busy with work and it fell by the wayside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants