angular-three icon indicating copy to clipboard operation
angular-three copied to clipboard

Bug - Soba Text whiteSpace

Open IRobot1 opened this issue 3 years ago • 0 comments

Current code looks like this

  @Input() set whiteSpace(whiteSpace: 'normal' | 'overflowWrap' | 'overflowWrap') {
    this.set({ whiteSpace });
  }

According to the troika-three-text code.

      /**
       * @member {string} whiteSpace
       * Defines whether text should wrap when a line reaches the `maxWidth`. Can
       * be either `'normal'` (the default), to allow wrapping according to the `overflowWrap` property,
       * or `'nowrap'` to prevent wrapping. Note that `'normal'` here honors newline characters to
       * manually break lines, making it behave more like `'pre-wrap'` does in CSS.
       */
      this.whiteSpace = 'normal'

Code should look like this

  @Input() set whiteSpace(whiteSpace: 'normal' | 'nowrap') {
    this.set({ whiteSpace });
  }

overflowWrap should be a separate property...

      /**
       * @member {string} overflowWrap
       * Defines how text wraps if the `whiteSpace` property is `normal`. Can be either `'normal'`
       * to break at whitespace characters, or `'break-word'` to allow breaking within words.
       * Defaults to `'normal'`.
       */
      this.overflowWrap = 'normal'

IRobot1 avatar Nov 02 '22 01:11 IRobot1