Skip to content
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

[iOS] Fix Editor placeholder issues #15883

Merged
merged 9 commits into from
Jul 31, 2023
Merged

[iOS] Fix Editor placeholder issues #15883

merged 9 commits into from
Jul 31, 2023

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Fix Editor placeholder issues on iOS/Catalyst:

  • Correct size.
  • Apply character spacing etc correctly.
Captura de pantalla 2023-06-27 a las 10 58 05

Added device tests and changes in the Editor sample page from the .NET MAUI Gallery (added samples using CharacterSpacing, Fonts etc).

Captura de pantalla 2023-06-27 a las 10 47 09

Issues Fixed

Fixes #15792
Fixes #15750

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/iOS 🍎 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-label Label, Span i/regression This issue described a confirmed regression on a currently supported version labels Jun 27, 2023
@jsuarezruiz jsuarezruiz marked this pull request as ready for review June 28, 2023 06:49
src/Core/src/Handlers/Editor/EditorHandler.iOS.cs Outdated Show resolved Hide resolved
Comment on lines 132 to 134
placeholderLabel.TextInsets = new UIEdgeInsets(edgeInsets.Top, edgeInsets.Left + lineFragmentPadding,
edgeInsets.Bottom, edgeInsets.Right + lineFragmentPadding);

Copy link
Member

Choose a reason for hiding this comment

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

What was not working with the existing TextInsets that the new LayoutConstraints fixes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto. Why did the old way not work? And if we need to use constraints, can we create them without using the VFL? That seems like an unnecessary performance hit for some fairly simple constraints.

Copy link
Contributor Author

@jsuarezruiz jsuarezruiz Jul 7, 2023

Choose a reason for hiding this comment

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

@rachelkang Was setting the LineFragmentPadding + edgeInsets.Right to the placeholder UILabel Width (that's why it was cut).
@hartez I recovered the approach used in XF, but you're right. I have applied changes to simplify it without using constraints etc.

What do the changes look like?. Instead of use the Frame, can apply changes to use TextInsets.

@samhouts samhouts added this to the .NET 8 GA milestone Jul 26, 2023
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

This looks good, but I am thinking we can also add a test for when the spacing changes. Can we verify that when the spacing changes the placeholder is updated.

And also a test to check the placeholder is mostly correct? So if you have a test that changes the editor width/height, does the placeholder also update?

I am thinking new tests:

  • placeholder size/pos is correct on init
  • placeholder character spacing is correct when editor spacing changes
  • placeholder size/pos is correct when editor spacing changes

@rmarinho rmarinho merged commit 2095668 into main Jul 31, 2023
@rmarinho rmarinho deleted the fix-15792 branch July 31, 2023 17:57
rmarinho added a commit that referenced this pull request Aug 3, 2023
* [create-pull-request] automated change (#16413)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [Windows] Fix Border corners clipping issue (#14403)

* Fix Border corners clipping mistake on Windows

* Updated impl

* Created method to avoid duplicated code

* Revert uneccesary changes

* Changes in clipping sizing

* Fix Rui issue

* Added device tests

* Remove unnecessary changes

---------

Co-authored-by: Javier Suárez <[email protected]>

* Add ViewHandler Mapper docs (#16296)

Co-authored-by: Juan Diego Herrera <[email protected]>

* [create-pull-request] automated change (#16427)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix device tests to tun on arm64 (#16408)

* Build on arm64

* magic

* Only install on Arm64 machines

* cleanup demands on the pipeline and add windows parameter

* Print system arch

* Fix getting OSArchitecture

---------

Co-authored-by: Rui Marinho <[email protected]>

* [uitests] Fix appium script (#16451)

* Bump node version

* Add more info to install script

* Try clean modules before install

* Uninstall before install

* fix

* Cleanup yaml

* Write output of drivers

* Try remove plugins before uninstall

* [iOS] Fix Editor placeholder issues  (#15883)

* Fix iOS Editor placeholder size, characterspacing and fontsize issues

* Added Device Test

* Invalidate CharacterSpacing updating the placeholder

* Updated Impl

* [Essentials] Make PublisherName public on NET8 (#16454)

* Fix EntryCellRenderer to use fromhandler for text changes (#16458)

* [compatibility] Skip test on iOS (#16452)

* [iOS] Re-enable editor tests (#16365)

* Re-enable editor tests on iOS

* Fix merge problem

* [build] Remove the old step for vs insertion on release (#16457)

* Reinstate IContentView and ILayout methods (#16411)

* Reinstate IContentView and ILayout methods
Fixes #16166

* Limit fake methods to NET Standard 2.0

* Reverse the polarity

* Simplify

* Work around compatibility implementations of ICV/ICPL methods on ScrollView

* Use correct interface for Frame

* [net8.0] Don't move to use arm yet here

* [net8.0] Make UpdateBackground public (#16453)

* [api] Make UpdateBackground public

* Keep extensions internal

* Fix issue setting ContentPage gradient background on iOS/Catalyst (#15832)

* Fix provisioning script

* [provisioning] Set Xcode path correctly for Xamarin Hosting

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Juan Diego Herrera <[email protected]>
Co-authored-by: Shane Neuville <[email protected]>
Co-authored-by: E.Z. Hart <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@samhouts samhouts added the fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-editor Editor area-controls-label Label, Span fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 i/regression This issue described a confirmed regression on a currently supported version platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
7 participants