Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

i/5831: Special characters grid tile should render correctly when the scrollbar shows up in the panel #2

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/ui/charactergridview.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,18 @@ export default class CharacterGridView extends View {

this.setTemplate( {
tag: 'div',
children: this.tiles,
children: [
{
tag: 'div',
attributes: {
class: [
'ck',
'ck-character-grid__tiles'
]
},
children: this.tiles
}
],
attributes: {
class: [
'ck',
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/charactergridview.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@ describe( 'CharacterGridView', () => {
} );

it( 'creates #element from template', () => {
const tile = view.createTile( 'ε', 'foo bar baz' );
const tilesElement = view.element.firstChild;

view.tiles.add( tile );

expect( view.element.classList.contains( 'ck' ) ).to.be.true;
expect( view.element.classList.contains( 'ck-character-grid' ) ).to.be.true;

expect( tilesElement.classList.contains( 'ck' ) ).to.be.true;
expect( tilesElement.classList.contains( 'ck-character-grid__tiles' ) ).to.be.true;

expect( tile.element.parentNode ).to.equal( tilesElement );
} );
} );

Expand Down
6 changes: 4 additions & 2 deletions theme/charactergrid.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

.ck.ck-character-grid {
display: grid;
grid-template-columns: repeat(10, 1fr);
& .ck-character-grid__tiles {
display: grid;
grid-template-columns: repeat( 10, 1fr );
}
}