We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
startsWith
1 parent 234d8b1 commit a83edf3Copy full SHA for a83edf3
src/object-position.ts
@@ -58,7 +58,7 @@ export function getPositioningTranslate(
58
// center.
59
const positionStr = objectPosition || '50% 50%';
60
61
- const splitIndex = positionStr.startsWith('calc') ?
+ const splitIndex = positionStr.lastIndexOf('calc', 0) === 0 ?
62
positionStr.indexOf(')') + 1 : positionStr.indexOf(' ');
63
const xPos = positionStr.slice(0, splitIndex) || '';
64
const yPos = positionStr.slice(splitIndex) || '';
0 commit comments