Skip to main content
Question

Nested list


Nikita34

Hello there.

I’m creating a regular bulleted list. Using setRangeListOptions().

text.characters = text.characters + i + ' line\n'
 text.setRangeListOptions(1,4, { type: "UNORDERED"} )

bul

Is it possible to create a nested list somehow? It looks like this:
nest

This topic has been closed for replies.

I am also trying to find the answer to this. In an unordered list text node “/n” adds a new line and creates a new bullet, e.g i am converting a string array to bullets:

bulletsText += `${input} ${
      stringArray.length - 1 === index ? "" : "\n"
    }

That works fine, so you would assume that “\t” (horizontal tab) would indent and create a nested bullet. It does not. Instead we are left with a tab space before the text but after bullet e.g
image

Any solution to this? I dont want to have to create a new node and alter its x pos.

Cheers


Gleb
  • Power Member
  • November 8, 2023

Have you tried setting indentation? Just an idea, I haven’t tried.

figma.com

Gave it a go.

Looks like setRangeIndentation indents all bullets in the node regardless of the start and end

Works better than repositioning the text node though so currently cloning the node and using setRangeIndentation on the sub lists.

Thanks for the response!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings