Answer the question
In order to leave comments, you need to log in
How to make the transition to the next slide on a given event?
There is a slider . There is an input outside the slider. How can I make the scroll forward function work when entering a certain word in the input?
const check =() => {какая-то магия}
return(
<input type="text" onKeyUp="check">
<swiper>
)
Answer the question
In order to leave comments, you need to log in
const [ text, setText ] = useState('');
const [ swiper, setSwiper ] = useState(null);
useEffect(() => {
if (swiper && text какой там вам нужен) {
swiper.slideNext();
}
}, [ swiper, text ]);
<Swiper
onSwiper={setSwiper}
...
<input
value={text}
onChange={e => setText(e.target.value)}
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question