Skip to content

Commit

Permalink
Merge pull request #143 from mbkim95/fix/link-click-handler
Browse files Browse the repository at this point in the history
Fix: LinkClickHandler does not work when clicking a link in the markdown list
  • Loading branch information
halilozercan authored Dec 1, 2024
2 parents 12d4cd7 + 20f0846 commit 1dd0e77
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ private val LocalListLevel = compositionLocalOf { 0 }
val contentsIndent = with(density) { listStyle.contentsIndent!!.toDp() }
val itemSpacing = with(density) { listStyle.itemSpacing!!.toDp() }
val currentLevel = LocalListLevel.current
val currentLinkClickHandler = LocalLinkClickHandler.current

PrefixListLayout(
count = items.size,
Expand All @@ -216,7 +217,10 @@ private val LocalListLevel = compositionLocalOf { 0 }
}
},
itemForIndex = { index ->
BasicRichText(style = currentRichTextStyle.copy(paragraphSpacing = listStyle.itemSpacing)) {
BasicRichText(
style = currentRichTextStyle.copy(paragraphSpacing = listStyle.itemSpacing),
linkClickHandler = currentLinkClickHandler
) {
CompositionLocalProvider(LocalListLevel provides currentLevel + 1) {
drawItem(items[index])
}
Expand Down

0 comments on commit 1dd0e77

Please sign in to comment.