question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reactive open state

See original GitHub issue

The v-slot tippy instance in the default slot is not reactive is there another way to get the current open state reactivley?

My use case is I want to have the default content highlighted a certain colour if the tippy is showing

I tried this but then ran into the issue that the isShown is not reactive

<template #default="{ tippy }">
      <div :class="tippy?.state.isShown ? 'bg-gray-300' : 'bg-gray-50'"  class="text-gray-400 select-none cursor-pointer p-2  rounded-md hover:bg-gray-50">
          Trigger tippy
      </div>
</template>
<template #content>
      <div class="px-2 h-auto py-2 text-white rounded bg-white shadow-xl border">
         Tippy content
      </div>
</template>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KABBOUCHIcommented, Dec 26, 2021

I’ve added a reactive state in v6.0.0-alpha.40

const { state } = useTippy(....)
<template #default="{ state }">
	<div :class="state.isShown ? 'bg-gray-300' : 'bg-gray-50'">
		Trigger tippy
	</div>
</template>
0reactions
KABBOUCHIcommented, Feb 28, 2022

@tonychuuy sry for the delay, fixed in v6.0.0-alpha.53, plz can u retry?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Reactive State Management? | by Ole Ersoy - Medium
Reactive State is state that updates continuously in response to specific events and is Observable . Lets develop a real world Typescript Stackblitz...
Read more >
Reactive state implementations (brainstorming) - GitHub
Reactive state is a state implemented by reducing values over time. There are two main questions to be asked for every particular library...
Read more >
How to Write a Super Simple Reactive State Manager - Halo Lab
Every application needs a state management system to have the ability to react to changes in the data. There are lots of state...
Read more >
Making React fast by default and truly reactive - Legend
Replacing global state AND all of the React hooks · When we use useObservable instead of useState and useReducer , components stop re-rendering ......
Read more >
Reactive Programming, State Management, and Redux for the ...
JavaScript can be a scary place where we create and change variables at will and while code can be written very quickly, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found