Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- JavaScript
- npm
- Regular expression
- eslint
- MySQL
- REACT
- Effective Java
- spring cloud
- Node
- nodejs
- regex
- java
- upgrade
- log_bin
- current_date
- git
- spring
- mysql 5.5
- log4j2
- update
- Chunk
- 퀵소트
- Spring Batch
- expire_logs_days
- REACTJS
- Express
- migration
- 정규표현식
- Webpack
- Effective Java 3/e
Archives
- Today
- Total
내 세상
[React] Dialog 위 Component Focus Setting 본문
728x90
반응형
React Dialog에서 Pop-up(sweetalert2 사용)을 띄웠을 때, focus를 잡지 못해 text/textarea 입력이 불가능함.
Dialog에서 sweetalert2/swal에 대한 focus를 위해서는 Dialog의 Option을 제어해야함.
disableEnfoceFocus={true} 로 설정해줌으로써 해결 가능.
sweetalert2 뿐 아니라 그 외의 toast/popup/alert 관련 모듈에서 공동적으로 발생할 수 있는 문제로 보임.
구글링했을 때 특정한 결과는 나오지 않지만, bootstrap에서 유사한 문제가 발생하는 것으로 유추됨.
<Dialog
disableEnforceFocus={true}
fullWidth={true}
maxWidth="xl"
open={this.state.open}
onClose={this.dialogClose}
TransitionComponent={Transition}
>
해당 옵션을 알지 못하고 Swal/Sweetalert2에서 option을 통해서 해결하려고 했으나 해결 안됨.
Swal.getContainer().focus() 등과 같이 container/content/button등을 확보할 수 있으나, focus()이 동작하지는 않음.
728x90
반응형
'Technical > React' 카테고리의 다른 글
[React] react-contextmenu에서 react-contexify로 변경한 이유 (0) | 2021.04.21 |
---|---|
[React] React Component/JSX Element to Html (0) | 2021.02.04 |
[React] Browser HTTP connetions in Node.js (0) | 2020.05.14 |
[React] Class Component / Function Component / Arrow Function (0) | 2020.05.11 |
[React] JSX / const, let, var (0) | 2020.05.11 |