Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Entry: Read-only entry #1678

Closed
PureWeen opened this issue Jan 26, 2018 · 18 comments · Fixed by #1972
Closed

[Enhancement] Entry: Read-only entry #1678

PureWeen opened this issue Jan 26, 2018 · 18 comments · Fixed by #1972
Assignees
Labels
community-sprint F100 inactive Issue is older than 6 months and needs to be retested t/enhancement ➕

Comments

@PureWeen
Copy link
Contributor

PureWeen commented Jan 26, 2018

Rationale

Currently you can set an Entry and Editor to IsEnabled false which technically makes it Read Only but it's greyed out. Is Read Only would present the field so it looks the same when it's editable but now it's not editable.

Implementation

Add IsReadonly property to InputView (base class of Entry and Editor)

public static readonly BindableProperty IsReadOnlyProperty = BindableProperty.Create(nameof(IsReadOnly), typeof(bool), defaultValue: false);

Renderers will make the platform native entry field uneditable but how it looks will not change

Currently the Entry and Editor controls inherit form InputView so need to verify that this enhancement works for both an Entry and Editor

Expected Result

Android

  • Entry.IsReadonly = true: should make the input control uneditable
  • Editor.IsReadonly = true: should make the input control uneditable

iOS

See Android

UWP

See Android

Implications for CSS

    user-select: none;

Backward Compatibility

This is adding a new property so should be backwards compatible. Need to ensure that the property defaults to false.

Difficulty : Easy

This is an easy change and great for a first time contributor.

@pauldipietro pauldipietro added this to New in Triage Jan 26, 2018
@PureWeen PureWeen changed the title Entry: Read-only entry [Enhancement] Entry: Read-only entry Jan 26, 2018
@jassmith jassmith added this to Ready for Implementation in Enhancements Jan 26, 2018
@almirvuk
Copy link
Contributor

Hi,

Can I be assigned to this issue :)

@davidortinau davidortinau moved this from Ready for Implementation to In Progress in Enhancements Jan 27, 2018
@davidortinau davidortinau self-assigned this Jan 27, 2018
@hartez hartez removed this from New in Triage Jan 29, 2018
@rmarinho
Copy link
Member

How does this work for iOS and UWP ?

@hartez
Copy link
Contributor

hartez commented Jan 30, 2018

How does this work for iOS and UWP ?

Same as Android.

@hartez
Copy link
Contributor

hartez commented Jan 30, 2018

@PureWeen Any reason this wouldn't make sense on Editor as well?

@PureWeen
Copy link
Contributor Author

@hartez I changed the spec to apply to the InputView and to verify implementation with the Entry and Editor controls

@jassmith
Copy link

Hey @almirvuk, you still working on this? If not we can move it back to the ready for work column

@almirvuk
Copy link
Contributor

Had some problems :( , I am planning to finish it by the end of tommorow, is that ok?

@jassmith
Copy link

More than OK :)

I am just checking in to make sure we're not losing track of things. Thank you for your efforts!

@alanag13
Copy link
Contributor

On iOS you can use: https://developer.xamarin.com/api/property/MonoTouch.UIKit.UIView.UserInteractionEnabled/

On Android you can use:
https://developer.xamarin.com/api/property/Android.Views.View.Focusable/

These will prevent text from being edited without changing the respective controls' appearances.

@almirvuk
Copy link
Contributor

Thanks! @alanag13, @PureWeen I implemented also for WPF and MacOS, I am also planing to finish Tizen and GTK if that is possible... so is that ok? (asking because in intro to this Enhancement there are Android, iOS and UWP)

@rookiejava
Copy link
Collaborator

On Tizen you can use AllowFocus().

@almirvuk
Copy link
Contributor

almirvuk commented Feb 20, 2018

Nice, thanks @rookiejava! I am very happy with my progress (as first time XF contributor), I will need day or two more to complete this :)

@almirvuk
Copy link
Contributor

@jassmith I made pull request to community repository, I am working on docs and some small improvements. I will make PR on official one in day or two 🙂

@jassmith
Copy link

Awesome

@samhouts samhouts added this to Ready in v3.1.0 via automation Apr 12, 2018
@samhouts samhouts moved this from Ready to In Progress in v3.1.0 Apr 12, 2018
@samhouts samhouts added this to In Progress in v3.6.0 May 7, 2018
@samhouts samhouts removed this from In Progress in v3.1.0 May 7, 2018
@samhouts samhouts removed this from In Progress in v3.6.0 May 18, 2018
@samhouts samhouts added this to In progress in Sprint 143 Oct 22, 2018
@samhouts samhouts removed this from In Progress in v3.6.0 Oct 23, 2018
@samhouts samhouts added this to In Progress in v3.5.0 Oct 23, 2018
@samhouts samhouts added this to To do in Sprint 144 Oct 31, 2018
@rmarinho rmarinho moved this from To do to Blocked in Sprint 144 Nov 14, 2018
@samhouts samhouts removed this from In Progress in v3.5.0 Nov 19, 2018
@samhouts samhouts added this to In Progress in v3.6.0 Nov 19, 2018
@samhouts samhouts removed this from In Progress in v3.6.0 Nov 19, 2018
@samhouts samhouts added this to In Progress in v3.6.0 Nov 19, 2018
@samhouts samhouts removed this from In Progress in v3.6.0 Nov 19, 2018
@samhouts samhouts added this to In Progress in v3.6.0 Nov 20, 2018
@samhouts samhouts removed this from the 3.4.0 milestone Nov 20, 2018
@samhouts samhouts removed this from In Progress in v3.6.0 Nov 20, 2018
@samhouts samhouts added this to In Progress in v3.6.0 Nov 20, 2018
@samhouts samhouts moved this from Blocked to Ready for Review (Issues) in Sprint 144 Nov 20, 2018
@samhouts samhouts added the inactive Issue is older than 6 months and needs to be retested label Jan 9, 2019
PureWeen pushed a commit that referenced this issue Jan 10, 2019
- fixes #1678
- fixes #4834

* InputView BindableProperty IsReadOnly

* Android Editor and Entry setup

* MacOS Editor and Entry setup

* Tizen Editor and Entry setup

* UAP Editor and Entry setup

* WPF Editor and Entry setup

* iOS Editor and Entry setup

* Issue1678 - TestContentPage added

* Tests added

* Tizen Editor and Entry fix

* UI Test fix

* Android fix for Entry and Editor.

* Unit Tests fix.

* Android Renderer first try.

* MacOS Entry renderer small fix.

* UpdateEditable fix.

* Android Entry and Editor reduced number of calls to BP.

* fix TestAttributes conflicts

* Remove keyboard

* [macOS] relinquish first responder

* [Android] remove call to UpdateCursorSelection

* [UWP] fix tabs
@samhouts samhouts moved this from In Progress to Done in v3.6.0 Jan 10, 2019
PureWeen pushed a commit that referenced this issue Jan 24, 2019
- fixes #1678
- fixes #4834

* InputView BindableProperty IsReadOnly

* Android Editor and Entry setup

* MacOS Editor and Entry setup

* Tizen Editor and Entry setup

* UAP Editor and Entry setup

* WPF Editor and Entry setup

* iOS Editor and Entry setup

* Issue1678 - TestContentPage added

* Tests added

* Tizen Editor and Entry fix

* UI Test fix

* Android fix for Entry and Editor.

* Unit Tests fix.

* Android Renderer first try.

* MacOS Entry renderer small fix.

* UpdateEditable fix.

* Android Entry and Editor reduced number of calls to BP.

* fix TestAttributes conflicts

* Remove keyboard

* [macOS] relinquish first responder

* [Android] remove call to UpdateCursorSelection

* [UWP] fix tabs
andreinitescu pushed a commit to andreinitescu/Xamarin.Forms that referenced this issue Jan 29, 2019
- fixes xamarin#1678
- fixes xamarin#4834

* InputView BindableProperty IsReadOnly

* Android Editor and Entry setup

* MacOS Editor and Entry setup

* Tizen Editor and Entry setup

* UAP Editor and Entry setup

* WPF Editor and Entry setup

* iOS Editor and Entry setup

* Issue1678 - TestContentPage added

* Tests added

* Tizen Editor and Entry fix

* UI Test fix

* Android fix for Entry and Editor.

* Unit Tests fix.

* Android Renderer first try.

* MacOS Entry renderer small fix.

* UpdateEditable fix.

* Android Entry and Editor reduced number of calls to BP.

* fix TestAttributes conflicts

* Remove keyboard

* [macOS] relinquish first responder

* [Android] remove call to UpdateCursorSelection

* [UWP] fix tabs
@samhouts samhouts added this to In Progress in v4.0.0 Feb 2, 2019
@samhouts samhouts removed this from Done in v3.6.0 Feb 2, 2019
@samhouts samhouts moved this from In Progress to Done in v4.0.0 Feb 4, 2019
@samhouts samhouts removed this from Done in v4.0.0 Feb 7, 2019
@samhouts samhouts added this to In Progress in v3.6.0 Feb 7, 2019
@samhouts samhouts moved this from In Progress to Done in v3.6.0 Feb 7, 2019
@Phenek
Copy link

Phenek commented May 12, 2019

Hey Guys,
Thanks for this property it work like a charm!

It would be great to have it also for Picker, DatePicker, TimePicker,
because there are also entries.
It would be nice to have :)

Regards,

@sarthak199526
Copy link

Hi guys I know this is too late but . With this read only property why Long click on entry text which opens copy selectAll option is not opening.Some might want allow user to copy and select specific text which can be easily achieved using this ReadOnly property of Entry if default entry long clicks functionality works.

Regards

@Elashi
Copy link
Contributor

Elashi commented Mar 27, 2021

Hi guys I know this is too late but . With this read only property why Long click on entry text which opens copy selectAll option is not opening.Some might want allow user to copy and select specific text which can be easily achieved using this ReadOnly property of Entry if default entry long clicks functionality works.

Regards

I believe that this is a basic requirement/feature/enhancement that should be enabled ASAP ! I cannot imagine a framework without this feature !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community-sprint F100 inactive Issue is older than 6 months and needs to be retested t/enhancement ➕
Projects
No open projects
Sprint 141
  
Blocked
Sprint 143
  
In progress
Sprint 144
  
Ready for Review (Issues)
v3.6.0
  
Done
Development

Successfully merging a pull request may close this issue.