keyboard on mobile devices opens every time when a...
# 👀feature-requests
s
Hey Botpress and Builders! I think it would be great for mobile device adoption, to prevent the keyboard from opening up when a button on the webchat is used. It would be a much smoother experience for mobile device users, which are the most on websites today I have tried it myself but wasnt able to use code to prevent it. Correct me If I am wrong, but it seems for me, that the buttons and the keyboard are connect and bc of that the keyboard is automatically activated when a button gets clicked but I could be wrong, Maybe there is already a way? let me know! would be great to hear from you about that improvement idea 🙂
w
100% most users visit websites via phones. Would be super intuitive!
b
100%%%%%
c
100000%
h
This would be aamzing. For now, I disable text input when it's a single choice
l
How are you disabling text?
h
@little-france-93089 // Check for button choices if (event.value.payload?.choices?.length > 0) { console.log('choices detected'); window.botpressWebChat.mergeConfig({ stylesheet: 'https://webchat-styler-css.botpress.app/prod/code/2e331228-e908-424a-ad7f-b22321453ec7/v54152/style.css' }); // Check for a dropdown } else if (event.value.payload?.type === 'dropdown') { console.log('Dropdown message received'); window.botpressWebChat.mergeConfig({ stylesheet: 'https://webchat-styler-css.botpress.app/prod/code/2e331228-e908-424a-ad7f-b22321453ec7/v54152/style.css' }); // Add any specific handling for dropdown messages here // Handle messages that are neither choices nor dropdown } else { console.log('No choices or dropdown detected'); window.botpressWebChat.mergeConfig({ stylesheet: 'https://webchat-styler-css.botpress.app/prod/code/2e331228-e908-424a-ad7f-b22321453ec7/v107/style.css' });
s
@helpful-electrician-82712 tried the code and on my Iphone nothing changed when clicking on single choice buttons
h
is the text entry disabled when the single choice button is presented? @some-portugal-41839
s
not really sure what you mean, it was as usual, what exactly should change?
h
you shouldn't be able to write into the bot (text box disabled) when it's a single choice button. and because it's disabled it shouldn't open up a keyboard
j
how?
h
@jolly-policeman-82775 change the stylesheet based on the question type. see code above. in one stylesheet the text box is disabled
j
huh
s
do you have a bot where i can test what you mean? because I just implemnted the code to mine and nothing has changed
2 Views