Skip to content

Tribute.js not working with iframe: true - mention alternatives? #432

@kauannolasco

Description

@kauannolasco

Problem

I'm trying to implement @mentions in Froala Editor using Tribute.js, but the autocomplete menu doesn't appear when iframe: true is enabled.

Current Setup

const tribute = new Tribute({
  trigger: '@',
  values: [/* contacts */]
})

// Froala config
{
  iframe: true, // ⚠️ Required - cannot disable
  // ...
}

// Attaching Tribute
froala.events.on('initialized', function() {
  tribute.attach(this.$iframe[0].contentWindow.document.body)
})

What Happens

  • ✅ Tribute initializes successfully
  • ✅ Gets attached to iframe body
  • ❌ Menu doesn't show when typing @
  • ✅ Works perfectly with iframe: false (but can't use it)

Question

How can I implement mentions with Froala in iframe mode?

Options:

  1. Make Tribute.js work with iframe?
  2. Alternative library that supports iframe?
  3. Build custom autocomplete?

Environment

  • Froala Editor: ^4.6.2
  • React Froala WYSIWYG: ^4.6.2
  • Tribute.js: ^5.1.3
  • React: ^18.2.0
  • CodeMirror: 5.3.0

Any help appreciated! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions