WordPress database error: [Can't create/write to file '/tmp/#sql-temptable-4db-156e26-4.MAI' (Errcode: 28 "No space left on device")]SELECT p.* FROM wp_mdb_forum_posts AS p LEFT JOIN wp_mdb_forum_posts AS q ON( q.Id = p.ParentId AND p.Id = q.AcceptedAnswerId ) WHERE p.PostTypeId = 2 AND p.ParentId = 106620 GROUP BY p.Id ORDER BY CASE WHEN q.Id IS NOT NULL THEN 1 ELSE 0 END DESC, p.UpvoteCount DESC, p.CreationDate ASC
Topic: How to give focus to MDBInput Component from MDB React
ragnarecek
pro asked 6 years ago
I am trying to find out how to give focus to Input Component from MDB React
This is the component
<Input label="Type a message" size="lg" ref={chatInput} />
In older version of React and MDB React I was able to do this
useEffect(() => {
!state.messagesAPI.isLoading && chatInput.current ? chatInput.current.setFocus() : null;
},
[state.messages]);
but now chatInput.current.setFocus
is no longer a function. Is there a better way how to autofocus or generally give a focus to the Input please?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: 4.25.2
- Device: PC
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No
Piotr Glejzer staff commented 6 years ago
Hello,
I think there is a problem with to set focus on it. I don't why is that happening at the moment. I will try to figure it out as soon as possible. Sorry about that.
ragnarecek pro commented 6 years ago
Is there any update on the issue with setFocus, please?
Piotr Glejzer staff commented 6 years ago
try to use prop
focused
ragnarecek pro commented 5 years ago
it doesnt seem to have the property focused or focus.
Piotr Glejzer staff commented 5 years ago
I will look into this but I'm so sure for 95% that is working. I will let you know.
aiivers commented 5 years ago
Were you able to resolve this? I'm having the same issue.
ragnarecek pro commented 5 years ago
Unfortunately, I have not been able to fix the issue. My code was working previously but stopped after an update and I have not been able to identify the root cause. Let me please know if you find anything.
Piotr Glejzer staff commented 5 years ago
I added a little time aga that code
https://git.mdbootstrap.com/mdb/react/re-pro/blob/master/src/components/Input/Input.js
and It should be work.
aiivers commented 5 years ago
I'm not clear on where I should add this code. Sorry if it's a noob question, I'm kind of new to this.
aiivers commented 5 years ago
I'm not clear on where I should add this code. Sorry if it's a noob question, I'm kind of new to this.
Piotr Glejzer staff commented 5 years ago
You don't have to do anything about that code. You have to add props
focused
to your component.aiivers commented 5 years ago
Still not working. Here is my code: import React, { Component } from "react"; import { MDBBtn, MDBInput, MDBContainer } from "mdbreact";
class Test extends Component { btnClick() { this.setState({ focus: "true" }); } state = { focus: "false" }; render() { return ( Focus ); } } export default Test;