简体   繁体   中英

disable iphone keyboard input for barcoder reader

Hi i have input which is used for text received from barcode reader, but when you focus this input iphone and other mobile browsers display the software keyboard, and this hide all buttons under the input, which you need also for your work.

Is there a way how to disable this iphone keyboard for this input? But blur is not solution, you need to type the barcode and press enter, that is what the reader do, it simulates the hardware keyboard.

If you pass your values to the text field with custom input, like with a datepicker for example, you can simply use readonly attribute in HTML or through JavaScript/jQuery:

/**
 * @param {Object} el : cache.datepicker => input element
 * @augments myCustom.fn.devicedetection from detectmobilebrowsers.com
 */
disableKeyboard: function (el) {
    if (myCustom.fn.deviceDetection === 'mobile') {
        el.prop({ readonly: true });
    }
},

Now it's not very clear what you mean by you need to type the barcode and press enter , you might want to elaborate on that one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM