Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

FIX: Carret position is invalid if editing text not at the end - #65

Merged
radimhalfar merged 2 commits into
masterfrom
bugfix/carret_position_is_invalid_while_editing_text
Mar 16, 2018
Merged

FIX: Carret position is invalid if editing text not at the end#65
radimhalfar merged 2 commits into
masterfrom
bugfix/carret_position_is_invalid_while_editing_text

Conversation

@radimhalfar

@radimhalfar radimhalfar commented Mar 16, 2018

Copy link
Copy Markdown
Contributor

@radimhalfar
radimhalfar requested a review from jakubpetrik March 16, 2018 14:27
- also added section for defining UI Elements and demonstrate usage of styles on it
@radimhalfar
radimhalfar force-pushed the bugfix/carret_position_is_invalid_while_editing_text branch from 788a9ca to 5ce8e53 Compare March 16, 2018 14:32
NSString *text = self.text;
if (!text || !style) {

if (!text || !style) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align

return;
}

UITextRange *range = self.selectedTextRange;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align


UITextRange *range = self.selectedTextRange;
[self setAttributedText:[style applyTo:text]];
if (range) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align

}
[self setAttributedText:[style applyTo:text]];

UITextRange *range = self.selectedTextRange;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is -- and all above too -- github shows that as invalid 🤷‍♂️


func didPickViewStyleDefinition(_ definition: ViewStyle.Definition) {
viewStyle = definition.viewStyle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line

@radimhalfar
radimhalfar force-pushed the bugfix/carret_position_is_invalid_while_editing_text branch from 4aa7ea5 to 5e7760d Compare March 16, 2018 15:04
@radimhalfar
radimhalfar merged commit 8249db2 into master Mar 16, 2018
@radimhalfar
radimhalfar deleted the bugfix/carret_position_is_invalid_while_editing_text branch April 27, 2018 08:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Carret position is invalid if not editing at the end of the text

2 participants