• Lourdes Montero Campos
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have a lightning-input-rich-text inside of a wrapper lwc(so that i can use it inside of a Aura cmp) and when we try to copy over a table, it comes over in the form of a paragraph. Here is the code:
.html
<template>
                <lightning-input-rich-text disabled-categories={disabledCategories}  valid={isValid} message-when-bad-input={badInputMesage}    ></lightning-input-rich-text>
    </template>
.js
import { LightningElement, api, track } from 'lwc';

export default class InputRichTextWrapper extends LightningElement {
    @api defaultVal;
    @api disabledCategories = '';
    @track isValid = true;
    @track badInputMesage = '';
    initialRender = true;

//after the first time the component is rendered, need to focus it, otherwise if there is an error
//displayed in the component, the styling would be off.
renderedCallback(){
    if(this.initialRender){
        this.initialRender = false; 
        this.template.querySelector('lightning-input-rich-text').value = this.defaultVal;
        this.template.querySelector('lightning-input-rich-text').focus(); 
        this.template.querySelector('lightning-input-rich-text').blur();
    } 
} 

//gets called from parent if need to change the valid attribute and the error.
@api setValidAttribute(isValidIn, message){
    this.isValid = isValidIn;
    this.badInputMesage = message;
}
@api getText(){
    return this.template.querySelector('lightning-input-rich-text').value;
} 
@api setText(valueIn){
    console.log('setting text' + valueIn);
    this.template.querySelector('lightning-input-rich-text').value = valueIn;
}
}


 
Hi,

I just ran into an issue using ui:textInput within aura:iteration
 
<aura:attribute name="test" type="String[]" default="test1, test2"></aura:attribute>

<aura:iteration items="{!v.test}" var="t">
      {!t}
      <ui:inputText value="{!t}"></ui:inputText>
</aura:iteration>

so when I type something in the input box and leave it, the output should change too, shouldnt it?
Any help?
Thanks!