Skip to content

Commit

Permalink
Merge branch 'next' into rework-views
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Dec 13, 2022
2 parents 4e51830 + 055b78b commit d6a20b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ describe('<DateField /> - Selection', () => {
render(<DateField autoFocus />);
const input = screen.getByRole('textbox');

expect(input.value).to.equal('MM / DD / YYYY');
expect(input.selectionStart).to.equal(0);
expect(input.selectionEnd).to.equal(input.value.length);
expectInputValue(input, 'MM / DD / YYYY');
expect(getCleanedSelectedContent(input)).to.equal('MM / DD / YYYY');
});

it('should select all on <Tab> focus', () => {
Expand All @@ -51,8 +50,7 @@ describe('<DateField /> - Selection', () => {
});

expectInputValue(input, 'MM / DD / YYYY');
expect(input.selectionStart).to.equal(0);
expect(input.selectionEnd).to.equal(input.value.length);
expect(getCleanedSelectedContent(input)).to.equal('MM / DD / YYYY');
});

it('should select day on mobile', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ export const useField = <

const firstSelectedSection = state.sections[selectedSectionIndexes.startIndex];
const lastSelectedSection = state.sections[selectedSectionIndexes.endIndex];

updateSelectionRangeIfChanged(
firstSelectedSection.startInInput,
lastSelectedSection.endInInput,
Expand Down

0 comments on commit d6a20b2

Please sign in to comment.