Skip to content

Chrome+Bootstrap tabs : U, I & B toolbar actions not working #567

Closed
@Tzaphkiel

Description

@Tzaphkiel

Having the editor initialized within a 'hidden' bootstrap tab indeed sets the contentEditable to false but setting it to true only restores the toolbar display, only B, U & I do not work.

The rest of the actions such as heading (inline or otherwise), the twitter and link action do work...

The whole toolbar also works on the first tab (the displayed one).

The fix proposed by #499 is not enough.

There are no errors in the console and the DOM does not change...

My editors are initialized on componentDidMount and their content are set by a bound this.children property.

The tabs change (show event) activates the editor using the following code set on the parent containing the tabs element (also setup on componentDidMount):

componentDidMount: ->
    console.debug "NodeDescriptor did mount"
    # FIXME Hack for chrome to set editable for initialized editors that were hidden
    $('a[data-toggle="tab"]').on 'shown.bs.tab', (e) ->
      editorId = $(e.target).attr('aria-controls') + 'Editor'
      $('#'+editorId).attr('contentEditable', true);
  • Chrome: fails
  • Firefox: works
  • dependencies:
  • "alloyeditor": "1.2.3",
    
  • "bootstrap": "3.3.6",
    
  • "react": "15.2.1",
    
  • "react-dom": "15.0.1",
    
  • "react-redux": "4.4.5",
    
  • "react-router": "2.5.2",
    
  • "redux": "3.5.2",
    
  • "redux-action": "1.0.0",
    
  • "redux-thunk": "2.1.0"
    
<div>
  <div id="headerEditor" class="editorSection cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, headerEditor" title="Rich Text Editor, headerEditor">
    <p><strong></strong>Node <strong>2158</strong> <u>header</u></p>
  </div>
  <div id="tabsEditors" class="editorSection">
    <ul class="nav nav-pills" role="tablist">
      <li role="presentation" class=""><a href="#overviewTab" aria-controls="overviewTab" role="tab" data-toggle="tab" aria-expanded="false">Overview</a></li>
      <li role="presentation" class="active"><a href="#mpsTab" aria-controls="mpsTab" role="tab" data-toggle="tab" aria-expanded="true">Most popular series</a></li>
      <li role="presentation" class=""><a href="#dsTab" aria-controls="dsTab" role="tab" data-toggle="tab" aria-expanded="false">Datasets</a></li>
      <li role="presentation" class=""><a href="#padTab" aria-controls="padTab" role="tab" data-toggle="tab" aria-expanded="false">Publications and Dashboards</a></li>
      <li role="presentation" class=""><a href="#tabMth" aria-controls="tabMth" role="tab" data-toggle="tab" aria-expanded="false">Methodology</a></li>
    </ul>
    <div class="tab-content">
      <div role="tabPanel" class="tab-pane fade" id="overviewTab">
        <div id="overviewTabEditor" class="editorContent cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, overviewTabEditor" title="Rich Text Editor, overviewTabEditor">overview tab content</div>
      </div>
      <div role="tabPanel" class="tab-pane fade active in" id="mpsTab">
        <div id="mpsTabEditor" class="editorContent cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, mpsTabEditor" title="Rich Text Editor, mpsTabEditor">Most Popular Series content</div>
      </div>
      <div role="tabPanel" class="tab-pane fade" id="dsTab">
        <div id="dsTabEditor" class="editorContent cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, dsTabEditor" title="Rich Text Editor, dsTabEditor">
          <p><strong>Datasets</strong> tab content</p>
        </div>
      </div>
      <div role="tabPanel" class="tab-pane fade" id="padTab">
        <div id="padTabEditor" class="editorContent cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, padTabEditor" title="Rich Text Editor, padTabEditor">Publications and Dashboards tab content</div>
      </div>
      <div role="tabPanel" class="tab-pane fade" id="tabMth">
        <div id="tabMthEditor" class="editorContent cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, tabMthEditor" title="Rich Text Editor, tabMthEditor"><u>Methodology</u> tab content</div>
      </div>
    </div>
  </div>
  <div id="footerEditor" class="editorSection cke_editable cke_editable_inline cke_contents_ltr ae-editable ae-placeholder" contenteditable="true" tabindex="0" spellcheck="true" role="textbox" aria-label="Rich Text Editor, footerEditor" title="Rich Text Editor, footerEditor">Node 2158 footer</div>
</div>

I can provide some more precision but not the code as it is part of a much bigger application...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions