-
Notifications
You must be signed in to change notification settings - Fork 1.4k
TextBoxMask Extension Binding Text Issue #3335
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
Comments
Hello rizamarhaban, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
@rizamarhaban Thanks for highlighting the bug. Is this something you can work on, create a PR ? |
Okay, will check the code first. |
@Kyaa-dost I found the code. It seems the correct |
@Kyaa-dost I have fixed the code however I cannot push my branch or create the PR. Need help on this. |
@rizamarhaban sounds like you just cloned the main repo. If you create a fork in GitHub: You should be able to change your remote to your new fork, then you can push your feature branch to your fork, and then submit a PR to our main repo here with the fix! Let us know if you need more help submitting the PR! Thanks! |
@michael-hawker I'm getting this failed test when running the unit tests. Is this something that I should leave it? it seems has no relation with my simple changes. Other tests passed. |
@rizamarhaban looks like the tests passed in the CI, but adding @Sergio0694 here for help with understanding why they might fail locally. |
Mmmh those crashes are very weird, also I'm pretty sure those |
@Sergio0694 @michael-hawker maybe this detail will help to resolve this, My laptop has 32GB memory, |
@rizamarhaban thanks, we've found the issue and it will be resolved by #3365. So, don't worry about those tests failing locally, you should be all good, thanks! I also was able to repro similar issues with just XAML directly here in the sample app: <TextBox Grid.Row="3"
x:Name="TestText"
Text="10:20:30"
Header="Source"
Style="{StaticResource MaskedTextBoxStyle}"/>
<TextBox Grid.Row="4"
extensions:TextBoxMask.CustomMask="5:[0-5]"
extensions:TextBoxMask.Mask="99:59:59"
Header="Target"
Text="{Binding Text, ElementName=TestText, Mode=TwoWay}"
Style="{StaticResource MaskedTextBoxStyle}" /> Taking a look at your PR suggested fix now, thanks! |
@michael-hawker Actually the second issue, the |
## Fixes #3335 When using the TextBoxMask extension, the TextBox text not updated if the text with the same string length changes, unless if the string length is less than the current Text length. ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more that apply to this PR. --> - Bugfix <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> <!-- - Sample app changes --> <!-- - Other... Please describe: --> ## What is the current behavior? Example, a TextBox with Mask `99:59:59` where cutom mask 5:[0-5], if the current Text is 10:20:30 and we update with 20:30:40, the Text did not changed/updated. The UI will show the same '10:20:30' because of this code: `textbox.Text = oldText;` ## What is the new behavior? Example, if the current Text is 10:20:30 and we update with 20:30:40, the Text changed/updated. The fix is to let the text updated on this regards and no other behavior changes. ## PR Checklist Please check if your PR fulfills the following requirements: - [ ] Tested code with current [supported SDKs](../readme.md#supported) - [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [ ] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets) - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) - [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [X] Contains **NO** breaking changes <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. Please note that breaking changes are likely to be rejected. --> ## Other information
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Applying TextBoxMask on TextBox control is working. However, when the binding value changes, the TextBox UI did not reflect the changes.
Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:Steps to Reproduce
Steps to reproduce the behavior (I'm using PRISM 6.x):
When Reset Button clicked, the
TextBox
did not update the UI. However, if we delete one digit at the back or delete any digit, the value updated.Expected behavior
When ResetToDefault Button clicked:
OpeningTime should be showing: 00:00:00
ClosingTime should be showing: 23:59:59
Screenshots
As we can see here, if the value entered following the mask correctly, and then we update the value via binding, the
TextBox
did not properly reflect the changes. However, if one of the digit is missing, the value is updated perfectly.Environment
NuGet Package(s):
Package Version(s):
Windows 10 Build Number:
App min and target version:
Device form factor:
Visual Studio
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: