-
Notifications
You must be signed in to change notification settings - Fork 90
Allow text selection while isSelectable = true but isEditable = false
#90
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| open override var canBecomeFirstResponder: Bool { | ||
| !isFirstResponder && isEditable | ||
| !isFirstResponder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| !isFirstResponder | |
| !isFirstResponder && isSelectable |
do you think it should check for isSelectable? That condition would match the Mac version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With !isFirstResponder && isSelectable, you can't edit under this case:
textView.isEditable = true
textView.isSelectable = false
So I suggest
!isFirstResponder && (isEditable || isSelectable)
But the problem is, you can't avoid selection under this case with above logic:
textView.isEditable = true
textView.isSelectable = false
Maybe we should add some documentation to clarify that when isEditable = true, isSelectable will be ignored.
|
Closed due to uncertainty. |
|
don’t close it yet. we need that. I didn’t have time to test it |
|
Sorry, I thought you would have other design decisions and this PR might block. |
as commit message