Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions modules/__tests__/createPrefixer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ describe('Static Prefixer', () => {
}
expect(prefix(input)).toEqual(output)
})

it('should prefix templating even with named grid lines', () => {
const input = { gridTemplateColumns: '1fr [header content] auto' }
const output = {
gridTemplateColumns: '1fr [header content] auto',
msGridColumns: '1fr [header content] auto',
msGridTemplateColumns: '1fr [header content] auto', // Not a valid property
}
expect(prefix(input)).toEqual(output)
})
})

describe('positions', () => {
Expand Down
8 changes: 4 additions & 4 deletions modules/plugins/grid.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* @flow */

function isSimplePositionValue(value: any) {
return typeof value === 'number' && !isNaN(value)
return typeof value === 'number' && !Number.isNaN(value)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I wonder if Number.isFinite is what you want here.

Also, I noticed that IE does not support either, so maybe what you originally had would be better in the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lencioni I went back to isNaN and removed the use of Set because I don't think IE11 supports constructing one from an iterable.

}

const alignmentValues = ['center', 'end', 'start', 'stretch']
const alignmentValues = new Set(['center', 'end', 'start', 'stretch'])

const displayValues = {
'inline-grid': ['-ms-inline-grid', 'inline-grid'],
Expand All @@ -13,7 +13,7 @@ const displayValues = {

const propertyConverters = {
alignSelf: (value: any, style: Object) => {
if (alignmentValues.includes(value)) {
if (alignmentValues.has(value)) {
style.msGridRowAlign = value
}
},
Expand Down Expand Up @@ -73,7 +73,7 @@ const propertyConverters = {
},

justifySelf: (value: any, style: Object) => {
if (alignmentValues.includes(value)) {
if (alignmentValues.has(value)) {
style.msGridColumnAlign = value
}
},
Expand Down