BiblioNexus-Foundation / scripture-editors

Monorepo for various Scripture editors
MIT License
3 stars 1 forks source link

Platform: Toolbar comment button cut in half on small editor width #126

Closed Sebastian-ubs closed 3 months ago

Sebastian-ubs commented 4 months ago

On a small editor width the other toolbar controls (back, forward, style) move up a bit to make space for a scrollbar, whereas the comment button stays and so is cut in half / overlayed by the horizontal scrollbar: grafik

In Firefox this is not seen, as Firefox uses a smaller scrollbar. In Chrome and Electron it is visible like can be seen above - this screenshot is from the scripture-editor codesandbox

Besides with a small editor width this also happens in a wider editor, when there is a long style name selected in the dropdown, which increases its width.

irahopkinson commented 4 months ago

@Sebastian-ubs thanks for trying things out in the editor. Any thoughts on what it should do instead? And/or how to fix it?

Sebastian-ubs commented 4 months ago

Not sure how technically those other ui elements shrink / re-arrange, but I would expect the comment button to behave similar.

Sebastian-ubs commented 4 months ago

In general the toolbar should ideally never need to show vertical scrollbars, but adapt to the available width by

Sebastian-ubs commented 4 months ago

a working solution seems to be

    .toolbar-item.block-controls {
      max-width: calc(100% - 140px);
      .icon.block-marker.nb {
        min-width: 20px;
      }
      .chevron-down {
        min-width: 16px;
      }
    }

Which of course is not very flexible with the hard coded 140px, but does its job for now.