Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ellipsizeMode='tail' with numberOfLines truncates at long word boundary instead of end of last line

オープン
#16,215 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp, react-native
領域
desktop, frontend

調査の方向性

ソースファイルもテストも指定されていません。まず、ellipsizeMode='tail'、numberOfLines={5}、固定幅、および提供された長い単語を含むテキストを使用して、React Native Windows の Text コンポーネントで問題を再現します。テキストが許可されたすべての行を使用し、省略記号が最後の行の末尾に表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug Needs: Triage :mag:
Problem Description

ellipsizeMode='tail' with numberOfLines truncates at a long-word boundary instead of at the end of the last allowed line.

When text contains a word longer than the line width, the ellipsis fires on line 2 as soon as that word overflow without firing at the actual last line allowed

Actual output (numberOfLines={5}):
Line 1: hree words eheh
Line 2: VeryloooooooooooooooooooooooongWoooooooo...
Line 3: Asdasd alskd askd krgpwpr woertjfg dv,neo odl sdflkpwe sdkflpwle kdmkm welr
Line 4: sdkflpwle kdmkm welr sdkfm ksmd k d fmd df d fd fd fd f
Line 5: df d f df d f df df

Expected output:
Line 1: VeryloooooooooooooooooooooooongWoooooooo
Line 2: oooooooooorddddddddddddddasdasdwasd
Line 3: Asdasd alskd askd krgpwpr woertjfg dv,neo odl sdflkpwe sdkflpwle kdmkm welr
Line 4: sdkflpwle kdmkm welr sdkfm ksmd k d fmd df d fd fd fd f
Line 5: df d f df d f df df...

Steps To Reproduce
  1. Render a component with ellipsizeMode='tail', numberOfLines={5}, and a fixed width.

  2. Set the text content to a string whose first word is longer than the component width,
    followed by several shorter words:

    <Text
    ellipsizeMode='tail'
    numberOfLines={5}
    style={{ width: 200 }}>
    VeryloooooooooooooooooooooooongWoooooooooooooooooorddddddddddddddasdasdwasd
    Asdasd alskd askd krgpwpr woertjfg dv,neo odl sdflkpwe sdkflpwle kdmkm welr
    sdkfm ksmd k d fmd df d fd fd fd f df d f df d f df df
    SASAD
    sdas

  3. Observe that the ellipsis appears at the end of the long word on line 1,
    while the remaining lines are unused.

Expected Results

The text should fill all numberOfLines lines before truncating.
The ellipsis should appear at the end of the last line

CLI version

20.0.0

Environment
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26100
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Memory: 7.54 GB / 31.69 GB
Binaries:
  Node:
    version: 20.20.0
    path: C:\nvm4w\nodejs\node.exe
  Yarn:
    version: 1.22.22
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\nvm4w\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.37216.2 (Visual Studio Professional 2022)
    - 16.11.37206.5 (Visual Studio Professional 2019)
Languages:
  Java:
    version: 2.formatMsgNoLookups
    path: C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_482\bin\javac.exe
  Ruby:
    version: 3.0.2
    path: C:\tools\ruby30\bin\ruby.exe
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.4
    wanted: 19.1.4
  react-native:
    installed: 0.81.6
    wanted: 0.81.6
  react-native-windows:
    installed: 0.81.15
    wanted: 0.81.15
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.85.3 is now available (your project is running on v0.81.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.85.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.81.6&to=0.85.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".
Community Modules

No response

Target React Native Architecture

None

Target Platform Version

None

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

主要言語
C++
スター
17.4k
フォーク
1.2k
平均マージ
2日 17時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/react-native-windows のほかの issue

microsoft/react-native-windows の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。