onekiloparsec / KPCTabsControl

A macOS control for tabs with enhanced capabilities, and styles: Safari, Chrome and custom ones.
MIT License
170 stars 26 forks source link

Editing unselectable items breaks default field editor #20

Closed DivineDominion closed 8 years ago

DivineDominion commented 8 years ago

When tabsControl(_:, canSelectItem:) return false, editing looks like expected -- until you hit the rightmost edge. Then unselectable items don't scroll:

aug-22-2016 10-16-30

Behind the scenes, for some reason the field editor is not embedded in a _NSKeyboardFocusClipView and grows to the right when you type.

It's because NSCell.selectable has side-effects:

When the value of this property is true, the cell’s text is selectable. Setting the value of this property to false also sets the editable property to false. If the value of this cell is true, the value in the editable property is not affected.

  • [x] Introduce a new tabIsSelectable property or similar