Giter VIP home page Giter VIP logo

Comments (6)

simeydk avatar simeydk commented on August 17, 2024 1

I would like to try addressing this. I may need some guidance, though :)

from takenote.

NathanBland avatar NathanBland commented on August 17, 2024 1

Typescript isn't normally my jam, but after hacking at this for a while I found you can get the event location, which should be right on the button being clicked:

  const handleNoteOptionsClick = (event: ReactMouseEvent, noteId: string = '') => {
    if (event instanceof MouseEvent) {
      console.log(`loc event`, event.pageX, event.pageY)
    }
    event.stopPropagation()

    if (node.current && node.current.contains(event.target as HTMLDivElement)) return
    setNoteOptionsId(!noteOptionsId || noteOptionsId !== noteId ? noteId : '')
  }

I can try and work at this more, but if @simeydk already has something going I'll leave it. Just thought I'd drop this off otherwise to be of some help. More than willing to jump in and help either way.

from takenote.

taniarascia avatar taniarascia commented on August 17, 2024

This issue is what appears in this CSS-Tricks post.

The sidebar for the notes, (.note-sidebar) should have a max-height of 100vh with overflow: hidden to hide any scroll. On hover, overflow-y: auto should be added, so a scrollbar appears only when you hover.

However, this actually sets overflow: hidden to the x-axis as well, and the .note-options-context menu gets cut off.

Currently, each note item has position: relative, and each menu has position: absolute. This won't work with overflow: hidden. We could use one container for the options and set the top and left with JavaScript, but I don't know how to send the coords properly with Hooks and Refs.

Ultimately, there should be one container for the options that gets populated on click with the proper data and coordinates set on the element.

from takenote.

taniarascia avatar taniarascia commented on August 17, 2024

I'm just leaving it with the many relative and absolute elements for now.

from takenote.

justinjunodev avatar justinjunodev commented on August 17, 2024

Thanks for sharing this. I sent some feedback via Twitter, that may be able to help. Good luck!

from takenote.

taniarascia avatar taniarascia commented on August 17, 2024

Please do.

from takenote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.