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.

V2 API / Wishlist šŸŽˆ

See original GitHub issue

Let me know what kind changes you would like to see.

V1 didn’t have any input from people so I’d like to prepare a bit better, such as the improving the naming of things, use cases, etc.

To align more with Popper.js I’m thinking:

JS:

  • data objects for each tooltip should rename the el property (the element given the tooltip) to reference (like Popper does)
  • getReferenceData() should just be getData()? (I had trouble trying to decide what it should be before)
  • Rename settings to options throughout (this seems to be more standard from what I’ve seen)
  • Get rid of src from package, add ESM/UMD files
  • Naming convention cleanup. I think going all lowercase makes things simple. tippy.Browser.SUPPORTED / tippy.Defaults should probably just be tippy.browser.supported and tippy.defaults?

CSS:

  • Switch from enter / leave ā€œglobalā€ classes to data attributes, like data-state="show" / data-state="hide"? Or x-state?
  • Rename arrow classes (.arrow-big etc) and use large in favor of big
  • Animation/Theme plugins for more options?
  • Also how about injecting CSS to the document straight from the JS to simplify it even further? Not sure if this is bad practice though.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:23 (19 by maintainers)

github_iconTop GitHub Comments

4reactions
atomikscommented, Sep 15, 2017

Some changes I’ve made (in v2-dev branch) so far:

  • The popper element now has popper.tippyReferenceElement property. Not sure of this name though… seems kind of long and not straight-forward. Since the popper element is created dynamically by the library itself, maybe just popper._reference?

  • Reference elements now have reference._tippy which refers to the instance. By default, calling show() / hide() / destroy() ... without passing in a popper element uses the first one inside store (so therefore it’s currently only useful with single-tooltip-instances)?

  • options is now used throughout instead of settings

  • Just use lowercase for all names now. tippy.browser.supportsTouch, etc. And tippy.browser.touch is now more semantically tippy.browser.usingTouch to indicate it’s a dynamic changing property. iOS is now not a function because using navigator.platform over navigator.userAgent appears to stay static on first load, so that’s now simplified

  • el renamed to reference throughout

  • data-* is now data-tippy-*

  • position is now placement (aligns with Popper.js)

  • x-* attributes have largely replaced classes and data-* attributes for popper/tooltip elements for cleaner CSS (less chance of naming collision)

3reactions
pomartelcommented, Sep 11, 2017

The html data attributes could be prefixed with tippy- to add some context and encapsulate the functionality. So for example, data-position would become data-tippy-position.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WishList Member API 2.0 Documentation
The WishList Member Application Programming Interface (API) version 2.0 provides an easy way for third-party developers to create applications that interactĀ ...
Read more >
Wishlist - BigCommerce Dev Center
An API key is a token that you provide when making API calls. Include the token in a header parameter called X-Auth-Token ....
Read more >
Wishlist API handler - Optimizely
This topic describes how to use the Wishlist API handler to add a single wishlist.
Read more >
Dez 10 – Creating a Wish List using Rest Api - YouTube
Santa's Wishlist this year should be fast to create, since time is in a hurry before Christmas this year.With the new REST -...
Read more >
Magento 2 : Wish list of customer Using API
Please find the Below Answer For Your Question for customer Wishlist. To create webapi in Magento 2, we need to create a file...
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