Skip to content

Commit

Permalink
WIP fix for navigate option in visitModal()
Browse files Browse the repository at this point in the history
See #19
  • Loading branch information
pascalbaljet committed Oct 24, 2024
1 parent 503b180 commit 21554b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions react/src/ModalRoot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { mergeDataIntoQueryString } from '@inertiajs/core'
import { createContext, useContext } from 'react'
import ModalRenderer from './ModalRenderer'
import { waitFor } from './helpers'
import { getConfig } from './config'

const ModalStackContext = createContext(null)
ModalStackContext.displayName = 'ModalStackContext'
Expand Down Expand Up @@ -269,6 +270,7 @@ export const ModalStackProvider = ({ children }) => {
options.onClose,
options.onAfterLeave,
options.queryStringArrayFormat ?? 'brackets',
options.navigate ?? getConfig('navigate'),
)

const visit = (
Expand Down
2 changes: 2 additions & 0 deletions vue/src/inertiauiModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Modal from './Modal.vue'
import ModalLink from './ModalLink.vue'
import ModalRoot from './ModalRoot.vue'

// TODO: Move this to modalStack.js + Add test for navigate option
function visitModal(url, options = {}) {
return useModalStack().visit(
url,
Expand All @@ -15,6 +16,7 @@ function visitModal(url, options = {}) {
options.onClose,
options.onAfterLeave,
options.queryStringArrayFormat ?? 'brackets',
options.navigate ?? getConfig('navigate'),
)
}

Expand Down

0 comments on commit 21554b2

Please sign in to comment.