@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
13 lines • 389 B
JavaScript
// only worry about the first row for now
export var findStickyHeaderForTable = function findStickyHeaderForTable(state, tablePos) {
if (!state || tablePos === undefined) {
return undefined;
}
var rowInfo = state.find(function (rowInfo) {
return rowInfo.pos === tablePos + 1;
});
if (!rowInfo) {
return undefined;
}
return rowInfo.sticky ? rowInfo : undefined;
};