#2388 - Add default tab stop (#2470)

* #2388 - Check for undefined rather than falsey

* Add default tab stop

* Add back tab stop positions

* Add test for default tab stop
This commit is contained in:
Dolan
2023-12-24 03:37:36 +00:00
committed by GitHub
parent abbd695a8f
commit 2bd4aacdd5
6 changed files with 29 additions and 3 deletions

View File

@ -157,9 +157,9 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
* Ensure there is only one w:tabs tag with multiple w:tab
*/
const tabDefinitions: readonly TabStopDefinition[] = [
...(options.rightTabStop ? [{ type: TabStopType.RIGHT, position: options.rightTabStop }] : []),
...(options.rightTabStop !== undefined ? [{ type: TabStopType.RIGHT, position: options.rightTabStop }] : []),
...(options.tabStops ? options.tabStops : []),
...(options.leftTabStop ? [{ type: TabStopType.LEFT, position: options.leftTabStop }] : []),
...(options.leftTabStop !== undefined ? [{ type: TabStopType.LEFT, position: options.leftTabStop }] : []),
];
if (tabDefinitions.length > 0) {