All Questions
Tagged with modal-dialog reactjs
699 questions
0
votes
0
answers
16
views
Always render an intercepted route in a modal even if navigating to the url directly in next.js
I am using the Parellel routes and route Interception to create a user experience that opens a form (the /new route) in a modal for the user to create their new thing. The route is /posts/new.
However,...
0
votes
0
answers
29
views
Shadcn Dialog X/close button not closing the Dialog
I have used the shadcn Dialog component in my react application as below:
Component:
.
.
.
import {
Dialog,
DialogTrigger,
DialogContent,
DialogHeader,
DialogTitle,
DialogClose,
} from '@/...
0
votes
0
answers
20
views
Issue with MUI 6.1.5 <Dialog> Styling not applying
Good day to all,
I seem to be having an issue with the styling of Dialog props from mui v6.1.5. I am trying to add some styling to the padding and margins, width to different Dialog Components but it ...
0
votes
1
answer
58
views
Overflow outside React portal dialog
I defined a base dialog for my dialogs using React createPortal and I am using react-select for my forms. In normal elements it works fine, but when I use it in a portal the options overflow result in ...
0
votes
1
answer
30
views
React not rendering alert when confirming comment deletion in modal
Context: interactive comment section CRUD app
When deleting a comment, the user clicks a Delete button which opens a modal to ask them to confirm the deletion. That part (the modal opening/closing and ...
0
votes
0
answers
31
views
positioning <dialogs> to the right not center
I have a dialog and I want it to be on the right side like a sidebar, but other parts of the page should not be accessible. So I am using a dialog but it's centered and I need it to be on the right ...
0
votes
1
answer
69
views
Create a dynamic react component using portal and promise
Call a modal or drawer from anywhere in my react app using simple a function.
I have made this work by using the root.render, but the problem with root.render they cannot found any of my previous ...
0
votes
2
answers
102
views
Pressing Escape key on modal triggers the escape event on the parent component
This is the main page.
"use client";
import React, { useEffect, useState } from "react";
import TestModal from "./TestModal";
const App = () => {
const [isOpen, ...
0
votes
0
answers
67
views
How to make the background of a Modal in React Native as white blurred?
I am using the TransitionPresets.ModalPresentationIOS to launch a Modal screen. I would like to make the top background of the Modal screen to a blurred white colour. I can't use Modal component in ...
0
votes
2
answers
59
views
How to have the same transparency mask on every ant design modal?
{filteredBookings.map((booking, index) => (
<Modal
key={index} // Make sure to provide a unique key
open={detailModalVisible}
...
0
votes
0
answers
23
views
Hide child component from parent with transition
I created this modal component:
interface ModalProps extends PropsWithChildren {
/***/
onClose: () => void;
}
const Modal: FC<ModalProps> = ({
/***/
onClose,
children
}) => {
...
0
votes
1
answer
174
views
Modal with React JS Best practice
I would like to make a modal window where the user can choose a team of 3 characters.
So far I've been using a state in the parent component like const [showModal, toggleModal] = useState(false);
But ...
0
votes
1
answer
37
views
Table data not getting updated until i refresh the page
The issue I'm encountering is that when I add data to the database through a modal component, the new data doesn't immediately appear in the table. It only shows up after I refresh the page. I ...
0
votes
0
answers
163
views
React-Native: SafeAreaView not working in Modal
Following is done for a mobile app on android in react native.
I want to display a text in the center of the screen, however even with a SafeAreaView it is not in the center, it is still a bit off, ...
0
votes
1
answer
39
views
Video isn't stopping even when I open modal
I have a video tag in which I am playing some video and passing that video to my modal as a prop. When I open the modal, the video still plays in the background. I want it to be stopped when I open ...
0
votes
2
answers
231
views
Data in modal is not updating in React JS
I creating clone of frontend of this website, everything is going smoothly but when I reached at cart section I find there is a lot of work. In short, I just create a Add to Cart button for my website ...
0
votes
1
answer
57
views
I want to disable the Formik validation when loading a modal
I am using Formik and Yup in my React Typescript project , I have a modal that will save a new value , I added Formik Validation to the Fields in my modal but when I click the add button in my page to ...
0
votes
2
answers
48
views
How to open a modal in a function
I want to open a modal by click a button which is supposed to export some datas in an excel file.
So there is my code but the modal is still close.
I'm new in react, did I do something wrong ?
Thank's ...
0
votes
0
answers
333
views
How to integrate Modal from Laravel Breeze React starter kit?
This was the original code from the Modal Component that came along with the Laravel Breeze React starter kit, but I can't see to get the modal to show up - is this code only for a dark background of ...
0
votes
1
answer
115
views
MUI Base Modal Backdrop Not Registering Clicks
I am attempt to implement a Modal using MUI Base Modal component and scss modules for styling:
import { Modal as BaseModal, ModalProps as BaseModalProps } from '@mui/base';
const Backdrop = () => &...
0
votes
0
answers
18
views
State not updating in Atlassian Modal using hooks
I'd like to show a flag (a separate component) on clicking Delete button. But state doesn't get updated, so flag isn't showing up. What might be the cause?
export const Modal: FC<Props> = ({
...
0
votes
1
answer
186
views
Does React modal window always causes parent's re-render?
I have developed a modal window with React several times and have always faced the problem of re-rendering the parent component.
For example, I am currently using MUI and react-transition-group to ...
0
votes
0
answers
23
views
How to prevent react native modal from moving up when keyboard opens in ios?
I tried to stabilise the modal, but when i touch the screen the modal goes upward and breaking down the style.
<Modal modalVisible={props.visibility} onClose={() => props.onclose()} ...
0
votes
3
answers
138
views
How to make the position of a modal window static when zooming or resizing the screen
The site (written in React, using Typescript and Tailwind) has a modal window. Modal is implemented using the "react-modal" library https://reactcommunity.org/react-modal/ .
With standard ...
0
votes
0
answers
19
views
Modals in React applications
I would like to ask you how you create and manage modals in your React applications. I saw the solution when modals are handled using Redux.For example you dispatch the modal key and props into the ...
0
votes
0
answers
22
views
Unable to close modal: setter function used to change variable state which closes modal never executes
Right now I'm working on a menu page for a website on the client side using Next.js. When the menu for a restaurant renders, each list item represents an item on the menu. Each menu item has its own ...
0
votes
0
answers
23
views
Using input outside Modal's container
I'm currently working with a modal that has a specific container. I also have an input component that is located outside of the modal. My goal is to be able to use (or interact with) this input ...
0
votes
0
answers
109
views
How to Ensure Modal Close Animation Plays on ESC Key Press in React with Framer Motion?
I'm using Framer Motion with React to animate a modal component's entrance and exit. The modal currently closes as expected when clicking outside of it or using a close button, with the exit ...
0
votes
0
answers
1k
views
Headless UI modal (dialog component) how do I close when clicking on children?
How do I close a modal window by clicking on any child link?
import { Dialog } from "@headlessui/react"
const [modalIsOpen, setModalIsOpen] = useState<boolean>(false)
<Dialog open=...
0
votes
1
answer
657
views
React modal dialog re-renders parent component - how to approach this
I have a parent component with reactive vars that are populated with data from a Mongo collection. The child modal dialog modifies this information, causing a re-render of the parent component — and ...
0
votes
2
answers
468
views
How do i effectively overlap modals in nexjts/react
Basically I want to create 3 modals stacked on top of one another, like the image below.
Clicking on the Create Ecosytem will open another shadcn Dialog like 2nd image below
The problem I am facing ...
0
votes
2
answers
71
views
How to open login modal using a button?
This is my login modal:
"use client";
import Link from "next/link";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import {
Card,
...
1
vote
0
answers
38
views
How to close current Dialog before opening another one?
This is my Login modal:
"use client";
import Link from "next/link";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import {
Card,
...
0
votes
0
answers
352
views
Radix UI modal getting called multiple times based on number of items. How should we call it only once
import { useState } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { TaskData, setTaskList } from '@/store/tasks'
import { RootState } from '@/store/rootReducer'
// ...
1
vote
0
answers
91
views
How to show a modal from inside a MUI Menuitem
I am trying to keep all the modal opening & closing logic inside the Menuitem component, as otherwise I have to write that login separately in multiple files wherever I am using this menuItem, &...
0
votes
2
answers
163
views
How to close bootstrap 5 modal with react
I am using bootstrap 5 with react in my project. I did not install it but using cdn links to use bootstrap element in the dom. I am using bootstrap modal to update data. After the update I want to ...
0
votes
0
answers
224
views
Modal taking click priority over Reactour component in react project
Problem: I have a React application where I'm using the Reactour library (https://github.com/elrumordelaluz/reactour) to provide a guided tour for users. However, I'm facing an issue where a modal ...
1
vote
1
answer
71
views
How do I display an array object in map onClick for modal?
I'm fairly new to React and I'm using NextJS. I have an array with role objects. I'm mapping over the array to display role name and description. What I'm trying to do is display the other array ...
-1
votes
1
answer
47
views
State does not change on Click
Here is my component code:
import React from "react";
import { useState } from "react";
import { Text, SvgContainer, Svg, Flex } from "../lib/styles";
import Modal from &...
0
votes
0
answers
419
views
how to open login modal on try to access protected routes in next js?
In my website, I use login form inside a modal instead of a login page. my question is how to open this login modal if a user try to access a protected route or even try to do some actions that need ...
0
votes
0
answers
109
views
Close modal window on first click
I have a modal window on my website, which is implemented using the library https://www.npmjs.com/package/react-modal.
Inside the modal window there is a Select (https://www.radix-ui.com/primitives/...
0
votes
0
answers
189
views
Controlling modal using custom hook does not work properly
I want to render Modal.tsx in MyInfoPage.tsx(or anywhere I want to show modal).
So, I created simple custom hook useModal.ts to control isOpenModal.
But, I encountered some rendering problem.
When I ...
0
votes
0
answers
28
views
In a list of items when clicked on location icon from the list, only related address modal will open using reactjs
In React, I have a list of items and each item of the list have a location icon link that opens a modal and need to show corresponding address.
But for me when I click on the particular location link, ...
0
votes
1
answer
283
views
antd Form inside modal does not submit in reactjs
I am trying to submit a form inside a modal form but the form does not submit and does not show any errors.
I have two forms in component. when the user click on the button it opens upd the modal so ...
0
votes
0
answers
87
views
State for open / close a modal window not working properly in reactjs
I want to open a modal window when I click on a button. You can find the complete code below.
When I click the button, the handleClickOpen function is correctly triggered (the debug console prints the ...
0
votes
1
answer
74
views
I'd like to have a button for Modal form on React-Select NoOptionsMessage
So, I have a searchable Select, and my goal is to let users add new item if and only no options left. That's why I wanted the button to appear on NoOptionsMessage.
const NoOptionsMessage = (props) =&...
0
votes
1
answer
32
views
Maintaining State of the same component
I have a question on maintaining a state for entire component. (Let's consider I have one Modal component which take list and display it)
I have one Modal component. This component includes list with ...
0
votes
1
answer
427
views
Create a portal modal is not working in React
I want to create a modal using React Portal, so here I have created a showModal container for modal data, a Modal container we can use to control the Modal, and in index.html, I want a wrapper for ...
3
votes
1
answer
7k
views
Next JS parallel routes don't work, getting 404
I'm trying to setup a basic Modal using parallel routes in Next 13 (app directory). Here is my file structure:
app
├── @create_recipe
│ ├── default.jsx
│ ├── page.jsx
├── layout.jsx
├── page.jsx
├─...
0
votes
2
answers
82
views
How do I create a modal in React which corresponds to the element a user clicked on?
I'm new to React, but I'm trying to create the functionality where a user can click on any one of the listed profile cards and then display a modal highlighting information about the respective card ...