Просмотр исходного кода

Merge pull request #18918 from overleaf/dp-swap-search-arrows

Swap order of next/previous arrows in editor search

GitOrigin-RevId: 2c402e177fcd679ebff8e96812faf09d493e9726
David 2 лет назад
Родитель
Сommit
7722c44414

+ 8 - 8
services/web/frontend/js/features/source-editor/components/codemirror-search-form.tsx

@@ -405,14 +405,6 @@ const CodeMirrorSearchForm: FC = () => {
 
 
         <div className="ol-cm-search-form-group ol-cm-search-next-previous">
         <div className="ol-cm-search-form-group ol-cm-search-next-previous">
           <ButtonGroup className="ol-cm-search-form-button-group">
           <ButtonGroup className="ol-cm-search-form-button-group">
-            <Button type="button" bsSize="small" onClick={() => findNext(view)}>
-              <Icon
-                type="chevron-down"
-                fw
-                accessibilityLabel={t('search_next')}
-              />
-            </Button>
-
             <Button
             <Button
               type="button"
               type="button"
               bsSize="small"
               bsSize="small"
@@ -424,6 +416,14 @@ const CodeMirrorSearchForm: FC = () => {
                 accessibilityLabel={t('search_previous')}
                 accessibilityLabel={t('search_previous')}
               />
               />
             </Button>
             </Button>
+
+            <Button type="button" bsSize="small" onClick={() => findNext(view)}>
+              <Icon
+                type="chevron-down"
+                fw
+                accessibilityLabel={t('search_next')}
+              />
+            </Button>
           </ButtonGroup>
           </ButtonGroup>
 
 
           {position !== null && (
           {position !== null && (

+ 3 - 3
services/web/test/frontend/features/source-editor/components/codemirror-editor.spec.tsx

@@ -505,8 +505,8 @@ describe('<CodeMirrorEditor/>', { scrollBehavior: false }, function () {
       cy.findByLabelText('Within selection').as('within-selection-label')
       cy.findByLabelText('Within selection').as('within-selection-label')
       cy.findByRole('button', { name: 'Replace' }).as('replace')
       cy.findByRole('button', { name: 'Replace' }).as('replace')
       cy.findByRole('button', { name: 'Replace All' }).as('replace-all')
       cy.findByRole('button', { name: 'Replace All' }).as('replace-all')
-      cy.findByRole('button', { name: 'next' }).as('find-next')
       cy.findByRole('button', { name: 'previous' }).as('find-previous')
       cy.findByRole('button', { name: 'previous' }).as('find-previous')
+      cy.findByRole('button', { name: 'next' }).as('find-next')
       cy.findByRole('button', { name: 'Close' }).as('close')
       cy.findByRole('button', { name: 'Close' }).as('close')
 
 
       // Tab forwards...
       // Tab forwards...
@@ -516,8 +516,8 @@ describe('<CodeMirrorEditor/>', { scrollBehavior: false }, function () {
       cy.get('@regexp').should('be.focused').tab()
       cy.get('@regexp').should('be.focused').tab()
       cy.get('@whole-word').should('be.focused').tab()
       cy.get('@whole-word').should('be.focused').tab()
       cy.get('@within-selection').should('be.focused').tab()
       cy.get('@within-selection').should('be.focused').tab()
-      cy.get('@find-next').should('be.focused').tab()
       cy.get('@find-previous').should('be.focused').tab()
       cy.get('@find-previous').should('be.focused').tab()
+      cy.get('@find-next').should('be.focused').tab()
       cy.get('@replace').should('be.focused').tab()
       cy.get('@replace').should('be.focused').tab()
       cy.get('@replace-all').should('be.focused').tab()
       cy.get('@replace-all').should('be.focused').tab()
 
 
@@ -525,8 +525,8 @@ describe('<CodeMirrorEditor/>', { scrollBehavior: false }, function () {
       cy.get('@close').should('be.focused').tab({ shift: true })
       cy.get('@close').should('be.focused').tab({ shift: true })
       cy.get('@replace-all').should('be.focused').tab({ shift: true })
       cy.get('@replace-all').should('be.focused').tab({ shift: true })
       cy.get('@replace').should('be.focused').tab({ shift: true })
       cy.get('@replace').should('be.focused').tab({ shift: true })
-      cy.get('@find-previous').should('be.focused').tab({ shift: true })
       cy.get('@find-next').should('be.focused').tab({ shift: true })
       cy.get('@find-next').should('be.focused').tab({ shift: true })
+      cy.get('@find-previous').should('be.focused').tab({ shift: true })
       cy.get('@within-selection').should('be.focused').tab({ shift: true })
       cy.get('@within-selection').should('be.focused').tab({ shift: true })
       cy.get('@whole-word').should('be.focused').tab({ shift: true })
       cy.get('@whole-word').should('be.focused').tab({ shift: true })
       cy.get('@regexp').should('be.focused').tab({ shift: true })
       cy.get('@regexp').should('be.focused').tab({ shift: true })