EasyUI Forum
April 27, 2024, 09:43:50 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Messager alert() not taking focus  (Read 4446 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: April 22, 2020, 03:07:01 PM »

in this example, click in the text box, then press tab to focus the button, then press enter to activate the button onClick.  you get the alert box, but now just press enter and watch the value in the text box increase

the LinkButton focus remains and accepts the keystrokes, even though the dialog appears modal and the button can't be clicked.


Code:
import React, { useRef, useState } from 'react';
import './App.css';
import { Form, FormField, LinkButton, Messager, TextBox } from 'rc-easyui';

function App() {
const messager = useRef();

const [model, setModel] = useState({
myBox:0
});

function onClick() {
setModel({
myBox: parseInt(model.myBox)+1
})
messager.current.alert({
title: "Clicked",
msg: "now press enter"
});
}

return (
<div className="App">
<Form
errorType="tooltip"
model={model}
labelWidth={120}
labelAlign="right"
>
<FormField name="myBox" label="Box:">
<TextBox value={model.myBox} tabIndex={1} />
</FormField>
<FormField >
<LinkButton onClick={onClick} >Tab to here and press enter</LinkButton>
</FormField>
</Form>
<Messager ref={messager}></Messager>
</div>
);
}

export default App;
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: April 26, 2020, 04:06:04 AM »

This issue has been fixed. Please update to the newest version.
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #2 on: April 27, 2020, 01:22:06 PM »

perfect, and Enter activates the OK button too.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!