mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-27 06:41:12 +00:00
Add autofocus to remote fetch modal input
This commit is contained in:
parent
fa37321dbd
commit
d6ed83d92f
1 changed files with 16 additions and 0 deletions
|
@ -80,11 +80,27 @@ export function SubscribeButton({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focusInput() {
|
||||||
|
document.getElementById("remoteFetchInstance")?.focus();
|
||||||
|
}
|
||||||
|
|
||||||
class RemoteFetchModal extends Component {
|
class RemoteFetchModal extends Component {
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
document
|
||||||
|
.getElementById("remoteFetchModal")
|
||||||
|
?.addEventListener("shown.bs.modal", focusInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount(): void {
|
||||||
|
document
|
||||||
|
.getElementById("remoteFetchModal")
|
||||||
|
?.removeEventListener("shown.bs.modal", focusInput);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in a new issue