EasyUI Forum
April 26, 2024, 06:00:36 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ComboBox Focus issue  (Read 10901 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: April 23, 2020, 01:26:05 PM »

When using editable={false} with a combobox, when a list item is selected focus is taken away from the combobox and not given back.  ideally, the list would not take focus away as it's all the same component.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


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

The ComboBox will get the focus again after selecting an item from the list. Please try to update to the newest version.
Logged
chrwei
Full Member
***
Posts: 219


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

is it possible to not trigger the onFocus event when the panel closes?
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #3 on: April 27, 2020, 02:50:40 PM »

After more testing this has additional issues. 

click the drop down arrow for one box, then click the drop down arrow for the other box, now use your keyboard up and down arrow keys and the first box is what is active.

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

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

const [model, setModel] = useState({
Box1:0,
Box2:2
});

return (
<div className="App">
<Form
errorType="tooltip"
model={model}
labelWidth={120}
labelAlign="right"
>
<FormField name="Box1" label="Box 1:" style={{float:"left"}}>
<ComboBox value={model.Box1} tabIndex={1} editable={false}
data={[
{ value: 0, text: "Item 0" },
{ value: 1, text: "Item 1" },
{ value: 2, text: "Item 2" },
]}
/>
</FormField>
<FormField name="Box2" label="Box 2:" style={{float:"left"}}>
<ComboBox value={model.Box2} tabIndex={2} editable={false}
data={[
{ value: 0, text: "Item 0" },
{ value: 1, text: "Item 1" },
{ value: 2, text: "Item 2" },
]}
/>
</FormField>
</Form>
</div>
);
}

export default App;

add this to your App.css and it'll highlight (literally) the issue

Code:
.form-field-focused {
  box-shadow: 0px 0px 3px 2px #eae885;
  background-color: #eae885;
}
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #4 on: April 28, 2020, 12:37:40 AM »

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


View Profile Email
« Reply #5 on: April 30, 2020, 11:51:21 AM »

onFocus is still firing multiple times for one click
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!