Skip to content

Commit

Permalink
Merge pull request #967 from basecamp/fix-attribute-check
Browse files Browse the repository at this point in the history
Fix ensureAttachmentExclusivelyHasAttribute
  • Loading branch information
afcapel authored Apr 6, 2022
2 parents 650d481 + 406b522 commit 72c7404
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/trix/core/collections/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class Hash extends TrixObject {
slice(keys) {
const values = {}

keys.forEach((key) => {
Array.from(keys).forEach((key) => {
if (this.has(key)) {
values[key] = this.values[key]
}
Expand Down
2 changes: 1 addition & 1 deletion src/trix/models/attachment_piece.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class AttachmentPiece extends Piece {
ensureAttachmentExclusivelyHasAttribute(attribute) {
if (this.hasAttribute(attribute)) {
if (!this.attachment.hasAttribute(attribute)) {
this.attachment.setAttributes(this.attributes.slice(attribute))
this.attachment.setAttributes(this.attributes.slice([ attribute ]))
}
this.attributes = this.attributes.remove(attribute)
}
Expand Down

0 comments on commit 72c7404

Please sign in to comment.