quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[QSelect][Safari] After select an option it scrolls to top of screen

Open robsontenorio opened this issue 3 years ago • 4 comments
trafficstars

What happened?

When you select any option on QSelect it scrolls to top of screen.

What did you expect to happen?

It should not scroll to top of screen

Reproduction URL

https://jsfiddle.net/q8c1xvkb/

How to reproduce?

REPRODUCTION 1

  1. Scroll down and select an option
  2. After selecting an option it scrolls up to top of screen.

REPRODUCTION 2

  1. Go to QSelect docs https://quasar.dev/vue-components/select#introduction
  2. Then select any option on examples.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Safari

Quasar info output

No response

Relevant log output

No response

Additional context

No response

robsontenorio avatar Jun 14 '22 14:06 robsontenorio

I tried the JSFiddle, the reference to the docs and in a freshly generated Vite project. I seem to have the expected outcome on Safari (Version 15.4 (17613.1.17.1.13)).

What version are you on?

output

bartduisters avatar Jun 18 '22 22:06 bartduisters

I am on macOS 13 beta developer.

Maybe it is the issue. Thanks !

robsontenorio avatar Jun 18 '22 23:06 robsontenorio

@robsontenorio Were you able to verify? If so, this issue can be closed.

bartduisters avatar Jun 24 '22 14:06 bartduisters

@bartduisters I can't verify because I can't go back to macOS 12 right now.

I am on macOS 13 beta2 and here it does not work.

image

robsontenorio avatar Jun 24 '22 16:06 robsontenorio

Sorry opened a dup(#14625 ) for this. I can confirm this happens on 16.0 on the docs page https://quasar.dev/vue-components/select

Also I noticed that it does not occur when using the multiple tag.

dehmlowm avatar Oct 14 '22 19:10 dehmlowm

A few other Notes as I am trying to find a work around: This also happens when tabbing to or from the qselect using Tab or Shift-Tab. The q-select is properly focused but the page scrolls to the top. Also happens when clear an existing selection that is clearable. If you use the Arrow keys to make a selection the press return or spacebar, it does NOT scroll Only occurs when using the mouse or tab key.

If you can look at the difference between making a selection using the arrow and enter keys and the click event that is likely the problem.

dehmlowm avatar Oct 14 '22 20:10 dehmlowm

Okay so a clunky work around is to use the multiple tag and limit the max values to one:

<q-select
    :options="['1', '2', '3']"
    multiple
    max-values="1"
    v-model="countArray"
    emit-value
  ></q-select

dehmlowm avatar Oct 14 '22 20:10 dehmlowm

It looks like ~IE11~ Safari has some problems with focusing 0 size elements :)

Add this to your css file until this fix is released

.q-select__focus-target, .q-select__autocomplete-input {
  width: 1px;
  height: 1px;
}

Please tell me if it happens even with this fix (Safari on macos or ios)

pdanpdan avatar Oct 14 '22 21:10 pdanpdan

It looks like ~IE11~ Safari has some problems with focusing 0 size elements :)

Add this to your css file until this fix is released

.q-select__focus-target, .q-select__autocomplete-input {
  width: 1px;
  height: 1px;
}

Please tell me if it happens even with this fix (Safari on macos or ios)

Added to app.scss and it behaves as expected thank you!!

dehmlowm avatar Oct 14 '22 21:10 dehmlowm

If someone has older versions of safari please test this and let us know if there are problems.

pdanpdan avatar Oct 15 '22 05:10 pdanpdan

Fix will be available in Quasar v2.10.1 & v1.21.1

rstoenescu avatar Oct 17 '22 06:10 rstoenescu