You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest a new feature or maybe enhancement on the current behavior with the following scenario:
A date input with mask 'M0/00', leadZeroDateTime="true", showMaskTyped - on dirty field.
When the customer fills the month value (ex. '02/__') the cursor position stays on the left side of the separator ('/') instead of the right. I guess that many of us can have different preferences here but especially when the mask is visible our teem need to provide better UX for the customer. When the cursor is not moved to the right side many of the customers are confused if they must do it manually and even if they want to do it they can't be sure which way is the right way.
In test it would looks like:
it('Mask M0/00 should set cursor on right position', () => {
cy.mount(CypressTestMaskComponent, {
componentProperties: {
mask: signal('M0/00'),
leadZeroDateTime: signal(true),
},
});
cy.get('#masked')
.type('3')
.should('have.value', '03/__')
.should('have.prop', 'selectionStart', 3);
});
Describe the solution you'd like
My proposal is whenever the mask is showed and the left side is completed and the current input event data is truthy (considering backspace scenarios) the cursor to be set after the separator position.
Describe alternatives you've considered
Currently we are using custom directive named expiryDateSmartCursor and we manually set the input selection range via setTimeout to avoid race conditions with the ngx-mask-directive actions
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
🚀 feature request
Description
I would like to suggest a new feature or maybe enhancement on the current behavior with the following scenario:
When the customer fills the month value (ex. '02/__') the cursor position stays on the left side of the separator ('/') instead of the right. I guess that many of us can have different preferences here but especially when the mask is visible our teem need to provide better UX for the customer. When the cursor is not moved to the right side many of the customers are confused if they must do it manually and even if they want to do it they can't be sure which way is the right way.
In test it would looks like:
it('Mask M0/00 should set cursor on right position', () => {
cy.mount(CypressTestMaskComponent, {
componentProperties: {
mask: signal('M0/00'),
leadZeroDateTime: signal(true),
},
});
cy.get('#masked')
.type('3')
.should('have.value', '03/__')
.should('have.prop', 'selectionStart', 3);
});
Describe the solution you'd like
My proposal is whenever the mask is showed and the left side is completed and the current input event data is truthy (considering backspace scenarios) the cursor to be set after the separator position.
Describe alternatives you've considered
Currently we are using custom directive named expiryDateSmartCursor and we manually set the input selection range via setTimeout to avoid race conditions with the ngx-mask-directive actions
The text was updated successfully, but these errors were encountered: