Skip to content

Commit

Permalink
Merge pull request #36 from viivue/staging-fix-outerClass-trim-string
Browse files Browse the repository at this point in the history
fix(outerClass): trim string to avoid adding empty class
  • Loading branch information
phucbm authored Oct 19, 2024
2 parents 70ca039 + 7812f69 commit e556229
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function generateHTML(context){
context.outer = wrapElement(context.overflow);
context.outer.classList.add(CLASSES.outer);
if(context.options.outerClass){
const classes = context.options.outerClass.split(' ');
for(let i = 0; i < classes.length; i++) context.outer.classList.add(classes[i])
const classes = context.options.outerClass.trim().split(' ');
for(let i = 0; i < classes.length; i++) context.outer.classList.add(classes[i])
}
context.outer.setAttribute(ATTRS.id, context.id);

Expand Down

0 comments on commit e556229

Please sign in to comment.