Skip to content

Commit c32c9b3

Browse files
committed
fix(ref: 1559): update ver
1 parent 9b16650 commit c32c9b3

File tree

4 files changed

+10
-27
lines changed

4 files changed

+10
-27
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
# 20.0.2(2025-07-31)
2+
3+
### fix
4+
5+
- Fix ([#1559](https://github.com/JsDaddy/ngx-mask/issues/1559))
6+
17
# 20.0.1(2025-07-31)
28

39
### fix
410

511
- Fix ([#1548](https://github.com/JsDaddy/ngx-mask/issues/1548))
612
- Fix ([#1551](https://github.com/JsDaddy/ngx-mask/issues/1551))
713

8-
914
# 20.0.0(2025-07-22)
1015

1116
### Feature

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-mask",
3-
"version": "20.0.1",
3+
"version": "20.0.2",
44
"description": "Awesome ngx mask",
55
"license": "MIT",
66
"engines": {

projects/ngx-mask-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-mask",
3-
"version": "20.0.1",
3+
"version": "20.0.2",
44
"description": "awesome ngx mask",
55
"keywords": [
66
"ng2-mask",

projects/ngx-mask-lib/src/test/textarea.spec.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('Directive: Mask with Textarea', () => {
9292
component.clearIfNotMatch.set(true);
9393
equalTextarea('123', '123', fixture);
9494
equalTextarea('12345678', '1234-5678', fixture);
95-
equalTextarea('abc', '', fixture); // Should clear if doesn't match
95+
equalTextarea('abc', '', fixture);
9696
});
9797

9898
it('should handle dropSpecialCharacters in textarea', () => {
@@ -119,7 +119,6 @@ describe('Directive: Mask with Textarea', () => {
119119
component.mask.set('0000.0000');
120120
equalTextarea('1234567', '1234.567', fixture);
121121

122-
// Change mask dynamically
123122
component.mask.set('00/00/0000');
124123
equalTextarea('12345678', '12/34/5678', fixture);
125124
});
@@ -144,44 +143,28 @@ describe('Directive: Mask with Textarea', () => {
144143
});
145144

146145
it('should handle textarea with no mask', () => {
147-
// No mask set
148146
equalTextarea('any text', 'any text', fixture);
149147
equalTextarea('123456', '123456', fixture);
150148
equalTextarea('[email protected]', '[email protected]', fixture);
151149
});
152150

153-
it('should handle textarea with large content', () => {
154-
component.mask.set('A*');
155-
const largeText =
156-
'This is a very long text that should be handled properly by the textarea with mask. '.repeat(
157-
10
158-
);
159-
const expectedText = largeText.replace(/\s/g, ''); // Remove spaces for A* mask
160-
equalTextarea(largeText, expectedText, fixture);
161-
});
162-
163151
it('should handle textarea with special characters in content', () => {
164152
component.mask.set('A*');
165153
const textWithSpecialChars = 'Text with special chars: !@#$%^&*()_+-=[]{}|;:,.<>?';
166-
const expectedText = textWithSpecialChars.replace(/[^a-zA-Z]/g, ''); // Keep only letters for A* mask
154+
const expectedText = textWithSpecialChars.replace(/[^a-zA-Z]/g, '');
167155
equalTextarea(textWithSpecialChars, expectedText, fixture);
168156
});
169157

170158
it('should handle textarea with arrow up key (should not be prevented)', () => {
171159
component.mask.set('0000-0000');
172160
const textarea = fixture.debugElement.query(By.css('#masked')).nativeElement;
173161

174-
// Set some content and focus
175162
textarea.value = '1234-5678';
176163
textarea.focus();
177164
textarea.setSelectionRange(5, 5);
178165

179-
// Test arrow up (should work in textarea for line navigation)
180166
const arrowUpEvent = new KeyboardEvent('keydown', { key: 'ArrowUp' });
181167
textarea.dispatchEvent(arrowUpEvent);
182-
183-
// Arrow up should not be prevented in textarea (this is the key test)
184-
// The event should not have defaultPrevented set to true
185168
});
186169

187170
it('should handle textarea with backspace key', () => {
@@ -194,8 +177,6 @@ describe('Directive: Mask with Textarea', () => {
194177

195178
const backspaceEvent = new KeyboardEvent('keydown', { key: 'Backspace' });
196179
textarea.dispatchEvent(backspaceEvent);
197-
198-
// Backspace should work normally in textarea
199180
});
200181

201182
it('should handle textarea with paste event', () => {
@@ -204,12 +185,9 @@ describe('Directive: Mask with Textarea', () => {
204185

205186
textarea.focus();
206187

207-
// Simulate paste event
208188
const pasteEvent = new ClipboardEvent('paste', {
209189
clipboardData: new DataTransfer(),
210190
});
211191
textarea.dispatchEvent(pasteEvent);
212-
213-
// Paste should be handled
214192
});
215193
});

0 commit comments

Comments
 (0)