Max length reached behavior - #451
Conversation
|
I've noticed that the unit test |
|
Also I've added a |
Pedro Jesus (pictos)
left a comment
There was a problem hiding this comment.
Hey, John Bijsterbosch (@jBijsterboschNL) good to see another PR from you! For now, I just have this small observation, let me know what do you think about it.
…set MaxLength to be used as parameter for command execution and event handler invoking
|
Pedro Jesus (@pictos) could you please take a look at his PR again? 👍 |
There was a problem hiding this comment.
John Bijsterbosch (@jBijsterboschNL) this is more a question than a request change. When I get the MaxLengt limit and go back to the entry, and type again the keyboard isn't dismissed. Is that expected? Please see the gif below to see how I tested.
Doing more investigation, when the MaxLength is reached, the view doesn't trigger the InputView.TextProperty.PropertChanged so the method OnTextPropertyChanged isn't called. Said that, to me it's ok to leave this way, but if you want to try something please let me know.
| var newTextValue = View.Text.Substring(0, View.MaxLength); | ||
|
|
||
| maxLengthReachedEventManager.RaiseEvent(this, new MaxLengthReachedEventArgs(newTextValue), nameof(MaxLengthReached)); | ||
|
|
There was a problem hiding this comment.
You have 3 tabs here, can you please remove it?
|
I think this has been discussed enough for now, let's merge it and see if there is anything to do after. |

Description of Change
Implemented MaxLengthReachedBehavior. When the MaxLength on an Entry field has been reached, any configured EventHandler gets invoked and a Command gets Executed.
Bugs Fixed
API Changes
Added:
Behavioral Changes
None
PR Checklist