Why does my search field not respond to input changes on mobile?

I recently recreated a website that has a search filter that narrows down a list of search results as the user types. The code in the markup of the component looks like this

<label for="searchBar" className={`srcryBox ${styles.searchLabel}`}>

    <input
        id="searchBar"
        type="search"
        className={ styles.searchBar }
        placeholder="search for groups"
        onKeyUp={ ( event ) => detectEnterKey( event ) }
        onChange={ ( event ) => handleKeyStrokes( event.target.value ) }
    />

    <button
        type="button"
        className={ styles.searchButton }
        onClick={ handleSearch }
    >
        search
    </button>

</label>

As you can see I use the onKeyup method to detect if the enter key is pressed which I use to perform a search and the onChange method to detect the current value inside the input. I also use an onClick event on a button to detect when the user taps it so a search is performed on the text they entered into the search bar. The detectEnterKey function just checks the event.key value and if it equals Enter it passes the current search value up to the parent component to filter results that match or start with the characters in the text. The handleKeyStrokes function updates a useState() hook with the current value of the search bar which is what gets passed up to the parent when the Enter key is detected in the detectEnterKey function. The handleSearch function also passes the current value up to the parent through the same prop when clicked.

Everything works perfectly fine on a computer with a keyboard. As I type I can see the search results narrowing down in the pane I have beneath the search bar. When I press enter or click the search button the search results appear or my no results text. However on mobile devices nothing happens as I type or press the return key and the search button doesn’t seem to do anything which I’m guessing is because the value in the search bar isn’t being updated through the onChange method.

I’ve been googling everything I can think of to try to find relevant info on this issue and have come across a few results where people were having this problem however they were using jquery or java. I looked into the touch api for javascript but it was a lot of stuff mainly about detecting where a user touches on the screen and being able to move draggable elements around. Is there a way to detect events from a mobile keyboard in javascript? You can visit the website at mketechmeetups.com to see for yourself.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật