收藏
回答

我在点击<input>时会触发<editor>的focus事件,是怎么回事呢?

,

微信版本 7.0.14,调试版本2.11.0

回答关注问题邀请回答
收藏

5 个回答

  • 社区技术运营专员-小柿子
    社区技术运营专员-小柿子
    05-12

    麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    05-12
    有用
    回复 1
  • 强15851218976
    强15851218976
    05-12

    你这个点击事件是冒泡事件

    https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html#%E4%BA%8B%E4%BB%B6%E8%AF%A6%E8%A7%A3

    05-12
    有用 1
    回复 6
    查看更多(1)
  • amiao😽
    amiao😽
    05-12
    <view class='main' wx:if='{{!success}}'>
    
     <form bindsubmit="formSubmit">   
      <view class="main-item" id="files_11">
       <view class="m-title m-title1 cols2 f32 fw"><text>人员资料编辑text>view>  
        <view wx:if='{{showMessage["所属人1"]!=0}}'>  
          <view class="m-row cols2" >
            <label class='txtLable'>与关系人的关系label>          
            <input placeholder='请输入所属关系' maxlength='10' name='relation' value='{{showMessage["所属关系"]}}'>input> 
          view>
        view>
        <view class="m-row cols2"> 
          <label class='txtLable'>名字label>       
          <input placeholder='请输入名字' maxlength='20' class="f32 fw {{genderIndex==1?'colorR1':''}}" name='name' value='{{showMessage["姓名"]}}' focus='{{focus1}}'>input> 
        view> 
        <view class="m-row cols2"> 
          <label class='txtLable'>字辈label>       
          <input placeholder='请输入字辈' maxlength='10' name='genName' value='{{showMessage["字辈"]}}'>input> 
        view>
        <view class="m-row cols2"> 
          <label class='txtLable'>label>       
          <input placeholder='请输入字' maxlength='10' name='word' value='{{showMessage["字"]}}' >input> 
        view>
        <view class="m-row cols2"> 
          <label class='txtLable'>label>       
          <input placeholder='请输入号' maxlength='10' name='num' value='{{showMessage["号"]}}'>input> 
        view>   
         
        <view class="m-row cols2"> 
          <label class='txtLable'>出生时间label>       
          <input placeholder='请输入出生时间'  name='birthday' value='{{showMessage["出生时间"]}}' >input> 
        view>
        <view class="m-row cols2"> 
          <label class='txtLable'>出生地点label>       
          <input placeholder='请输入出生地点' name='bornAddr' value='{{showMessage["出生地点"]}}'>input> 
        view>
       
        <view class="m-row cols2"> 
          <label class='txtLable'>去世时间label>       
          <input placeholder='请输入去世时间' name='deathDay' value='{{showMessage["去世时间"]}}'>input> 
        view>
        <view class="m-row cols2"> 
          <label class='txtLable'>卒葬地点label>       
          <input placeholder='请输入卒葬地点' name='deathAddr' value='{{showMessage["卒葬地点"]}}'>input> 
        view> 
        <view class="m-row cols2"> 
          <label class='txtLable'>居住地址label>       
          <input placeholder='请输入居住地址' name='addr' value='{{showMessage["居住地址"]}}' >input> 
        view>
       
      view>  
      <view class="main-item" >
        <view class="m-title cols2 f32 fw"><text>传记text>view>
        <view>
         <textarea maxlength='500' bindfocus="zhuanjiInput" placeholder='请输入传记(最多500字)' name='content' value='{{showMessage["特殊说明"]}}' >textarea> 
        view>
      view> 
      
      <view class="main-item1 " >   
        <view class="m-title cols2 " >
          <view class="f32 fw">图文介绍view>     
        view>   
        <view class='editor {{editorFocus?"editor-fixed":""}}'>
         
          <view class="e-con ">   
            <view class='toolbar {{editorFocus?"toolbar-fixed":""}}' catchtouchend="format" wx:if='{{showToolbar}}'>
            
              <i class="iconfont icon-zitijiacu {{formats.bold ? 'ql-active' : ''}}" data-name="bold">i>
              <i class="iconfont icon-zitixieti {{formats.italic ? 'ql-active' : ''}}" data-name="italic">i>
              <i class="iconfont icon-zitixiahuaxian {{formats.underline ? 'ql-active' : ''}}" data-name="underline">i>
              <i class="iconfont f28 fw" data-name="blur" catchtouchend="blur">返回i>
            view>
            <view class="editor-con">
              <editor id="editor" class="ql-container" placeholder="请输入内容" showImgSize showImgToolbar showImgResize bindstatuschange="onStatusChange"  read-only="{{readOnly}}" bindready="onEditorReady" bindinput='onEditorInput' name='info' bindfocus='onEditorFocus' bindblur='onEditorBlur' style="height:{{editorFocus?editorHeight-40:''}}px;margin-top:{{editorFocus?toolbarHeight:''}}px;">
              editor>
                
            view> 
          view> 
        view>   
      view>
    form>
    
    view>
    
    
    05-12
    有用
    回复 1
    • amiao😽
      amiao😽
      05-12
      电脑调试没有,手机(华为 Nova5),发现有这个问题,点input 触发 onEditorFocus
      05-12
      回复
  • 祺爸💎
    祺爸💎
    05-12

    你好,请提供能复现问题的简单代码片段

    https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    --↓↓👍点击“有用”是回答的动力哦

    05-12
    有用
    回复 1
    • amiao😽
      amiao😽
      05-12
      发了 代码,请看下~
      05-12
      回复
  • จุ๊บ
    จุ๊บ
    05-12

    亮代码

    05-12
    有用
    回复 1
    • amiao😽
      amiao😽
      05-12
      发了 代码,请看下~
      05-12
      回复
登录 后发表内容
问题标签