Skip to content

QKnob with image content in default slot can't be interacted with to update model value #17812

@euphemism

Description

@euphemism

What happened?

mousing over a Knob component with an image in the default slot results in the browser's default image dragging behavior to override the QKnobs behavior:

from: https://quasar.dev/vue-components/knob#example--show-value

<q-knob
  show-value
  font-size="10px"
  class="q-ma-md"
  v-model="value"
  size="80px"
  :thickness="0.25"
  color="primary"
  track-color="grey-3"
>
  <q-avatar size="60px">
    <img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">
  </q-avatar>
</q-knob>
Screen.Recording.2025-02-07.at.8.43.16.AM.mov

Adding pointer-events: none to the slot's containing element resolves the problem:

Screen.Recording.2025-02-07.at.8.41.28.AM.mov

What did you expect to happen?

I expected to be able to click and drag on the knob, changing the value.

Reproduction URL

https://codepen.io/euphemism-the-encoder/full/zxOgpbV

How to reproduce?

  1. Go to link
  2. Click and drag on knob (Quasar logo image in center)
  3. Observe browser-native image dragging behavior instead of model change

Flavour

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

Areas

Components (quasar)

Platforms/Browsers

Firefox, Safari, iOS, Chrome

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions