Skip to content

Conversation

@KaelWD
Copy link
Member

@KaelWD KaelWD commented Mar 10, 2021

fixes #5886
fixes #9283

On dev in case it breaks safari again.

Markup:

<template>
  <v-app>
    <v-navigation-drawer
      v-model="drawer"
      app
      temporary
    >
      <v-text-field
        class="px-3"
        value="https://google.com"
        clearable
      />
    </v-navigation-drawer>

    <v-container>
      <v-btn
        icon
        @click="drawer = !drawer"
      >
        <v-app-bar-nav-icon />
      </v-btn>

      <div
        id="a"
        v-click-outside="onClickOutside"
      ></div>

      <v-menu
        v-model="linkMenu"
        bottom
        :close-on-content-click="false"
        offset-y
      >
        <template #activator="{ on }">
          <v-btn
            icon
            v-on="on"
          >
            <v-icon>mdi-link</v-icon>
          </v-btn>
        </template>

        <v-form
          class="white"
          @submit.prevent="linkMenu=false"
        >
          <v-text-field
            class="px-3"
            value="https://google.com"
            clearable
          />
        </v-form>
      </v-menu>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    data: () => ({
      drawer: false,
      linkMenu: false,
    }),
    methods: {
      onClickOutside (e) {
        console.log(e)
      },
    },
  }
</script>

<style>
#a {
  width: 100px;
  height: 100px;
  background: grey;
  margin: 50px;
}
</style>

@KaelWD KaelWD added T: enhancement Functionality that enhances existing features D: click-outside labels Mar 10, 2021
@KaelWD KaelWD added this to the v2.5.0 milestone Mar 10, 2021
@KaelWD KaelWD self-assigned this Mar 10, 2021
@jacekkarczmarczyk
Copy link
Member

Does it solve #4432 as well?

@KaelWD
Copy link
Member Author

KaelWD commented Mar 10, 2021

No, that's not related to click-outside.

Copy link
Member

@johnleider johnleider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this require anything special to update to next branch? Does the iOS change have any potential side effects that you are aware of?

@KaelWD
Copy link
Member Author

KaelWD commented Mar 16, 2021

  • No
  • Might break click-outside on iOS, but removes the need for v-app. It worked on browserstack but you know how Apple is

@johnleider

This comment has been minimized.

@KaelWD

This comment has been minimized.

@KaelWD KaelWD changed the title fix(click-outside): don't trigger if mousedown was inside target fix(click-outside): don't trigger if mousedown inside target Mar 17, 2021
@KaelWD KaelWD merged commit f4f8c7a into dev Mar 17, 2021
@KaelWD KaelWD deleted the fix/5886-click-outside-drag branch March 17, 2021 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

D: click-outside T: enhancement Functionality that enhances existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants