Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BelongsTo::make()->searchable() Not Suggesting Values on Android #6595

Open
monter08 opened this issue Nov 29, 2024 · 7 comments
Open

BelongsTo::make()->searchable() Not Suggesting Values on Android #6595

monter08 opened this issue Nov 29, 2024 · 7 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Milestone

Comments

@monter08
Copy link

Laravel Version: 10.x
Nova Version: 4.35.5
PHP Version: 8.2.x
Database Driver & Version: MySQL 8.0.x
Operating System and Version: Android 12
Browser type and version: Chrome 131.0.6778.81

Description:

The BelongsTo field with the ->searchable() method does not suggest any values when accessed on Android devices using Chrome. This issue was tested on multiple Android devices and persists across all of them.

Detailed steps to reproduce the issue on a fresh Nova installation

  1. Set up a fresh Laravel Nova application with version 4.35.5.
  2. Create a BelongsTo field in a resource, e.g.,
   BelongsTo::make(__('Select'), 'select', Data::class)->searchable(); 
  1. Deploy the application and access the Nova resource page using an Android device with Chrome.
  2. Click on the searchable dropdown and attempt to type and search for values

Actual Result:
No suggestions are displayed.

On Desktop this work well.

@monter08 monter08 changed the title Bug Report: BelongsTo::make()->searchable() Not Suggesting Values on Android BelongsTo::make()->searchable() Not Suggesting Values on Android Nov 29, 2024
@crynobone
Copy link
Member

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

Screen_Recording_20241201_163009_Chrome.mp4

@crynobone crynobone added the needs more info More information is required label Dec 1, 2024
@OliOnline
Copy link

OliOnline commented Dec 1, 2024

I have a similar issue and can add more details (on web browser also).

When creating a new resource with a belongTo relationship, having the searchable option, the field initially display zéro option, we absolutely need to search for something in order to see any options.

Even if "relatableQueryUsing" is fired, and I could get all the options I'd like to display, I still need to enter some characters to be able to have options showing up.

Also, when editing the resource, it works, I can show "initial options", probably because there is already something in the search field ?

@crynobone
Copy link
Member

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

@monter08
Copy link
Author

monter08 commented Dec 2, 2024

Repository: https://github.com/monter08/nova-issue-6595

example.mov

@monter08
Copy link
Author

monter08 commented Dec 2, 2024

it looks like an event onkeypress on mobile not work (only event blur starts the search), while searching i came across the topic: https://stackoverflow.com/questions/50617865/vue-v-model-input-change-mobile-chrome-not-work

@crynobone crynobone added fix incoming A fix is in review pending Issues that are pending triage and removed fix incoming A fix is in review labels Dec 4, 2024
@monter08
Copy link
Author

monter08 commented Dec 9, 2024

Taking into this comment and other similar threads discussing the issue, the easiest way to reproduce the problem is to visit this link on an Android device (and probably with the Gboard keyboard).

To solve the problem, I suggest changing the way data is passed in laravel/nova/resources/js/components/Inputs/SearchInput.vue from:

<input v-model="searchValue" .../>

to:

<input @input="e => searchValue = e.target.value" />

This solution works for me.

@crynobone
Copy link
Member

crynobone commented Dec 11, 2024

I'm not keen on making a PR to change the default as certain language and keyboard settings would require multiple inputs before accepting it as a character input.

Will need to revisit into previous issues related to keyboard input before fixing this.

@crynobone crynobone added this to the 5.1.x milestone Dec 19, 2024
@crynobone crynobone added bug Verified bug by the Nova team fix incoming A fix is in review and removed needs more info More information is required pending Issues that are pending triage labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

3 participants