metafizzy / huebee

🐝 1-click color picker
https://huebee.buzz
402 stars 43 forks source link

Opens offscreen #7

Open matthewlein opened 7 years ago

matthewlein commented 7 years ago

Another classic—should tooltips ever open offscreen?

IMO, no, thats something I want a library to take care of, and I would guess users would want that too. Inputs at the bottom of a page (or side, depending on where you want it to open).

desandro commented 7 years ago

Add a 👍 reaction to this issue if you would like to see Huebee add a feature so its always positioned within the page viewport.


One way to resolve this is to set positioning CSS

/* outside right edge? */
.huebee__container {
  left: -100px;
}

/* or too close to bottom? */
.huebee-container {
  top: auto;
  bottom: 50px;
}

Rather add more code to check and measure sizing values, I hope developers can rely on their own CSS to resolve these offscreen issues.

This brings up another feature: more robust positioning. Huebee defaults to being positioned below the bottom left corner of the anchor element. Would it be better if Huebee had options for being positioned at any corner with any orientation (right, left, top, bottom)? See #8