-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[form-builder] Wrap react-datepicker in Layer
This fixes a bug where since we used the React usePortal the popper would render underneath the current Sanity UI `Layer`.
- Loading branch information
1 parent
1d7c63e
commit 9573931
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe('DatetimeInput react-datepicker popper', () => { | ||
beforeEach(() => { | ||
cy.visit( | ||
'/test/desk/datetimeTest%2Ctemplate%3DdatetimeTest;b44f31f5-2cb0-431b-a912-aba0e1bf46cd' | ||
) | ||
}) | ||
|
||
it('should be rendered on top of array input dialog', () => { | ||
cy.getField('inArray').within(($field) => { | ||
cy.contains('Add').scrollIntoView().should('be.visible') | ||
cy.contains('Add').click() | ||
}) | ||
|
||
cy.getField('date').within(($dateField) => { | ||
cy.get('button[title="Select date"]').click() | ||
}) | ||
|
||
cy.get('.react-datepicker-popper').should('be.visible') | ||
}) | ||
|
||
it('should be visible when clicking select date', () => { | ||
cy.getField('justDefaults').within(($field) => { | ||
cy.get('button[title="Select date"]').click() | ||
}) | ||
|
||
cy.get('.react-datepicker-popper').should('be.visible') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters