Skip to content

Commit

Permalink
Merge pull request #14676 from ckeditor/ck/14495-support-for-capital-…
Browse files Browse the repository at this point in the history
…case-letters-in-color-inputs

Fix(table): Added support for capital case letters in the color inputs. Closes #14495.
  • Loading branch information
Dumluregn authored Jul 28, 2023
2 parents f220644 + 9aaed10 commit 1a58a6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ckeditor5-table/src/utils/ui/table-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function getLocalizedLengthErrorText( t: LocaleTranslate ): string {
* See {@link module:engine/view/styles/utils~isColor}.
*/
export function colorFieldValidator( value: string ): boolean {
value = value.trim();
value = value.trim().toLowerCase();

return isEmpty( value ) || isColor( value );
}
Expand Down
2 changes: 2 additions & 0 deletions packages/ckeditor5-table/tests/utils/ui/table-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ describe( 'table utils', () => {
expect( colorFieldValidator( '#FFF' ) ).to.be.true;
expect( colorFieldValidator( '#FFAA11' ) ).to.be.true;
expect( colorFieldValidator( 'rgb(255,123,100)' ) ).to.be.true;
expect( colorFieldValidator( 'RGB(255,123,100)' ) ).to.be.true;
expect( colorFieldValidator( 'RED' ) ).to.be.true;
expect( colorFieldValidator( 'red' ) ).to.be.true;
} );

Expand Down

0 comments on commit 1a58a6b

Please sign in to comment.