AssistoLab / DropDown

A Material Design drop down for iOS
MIT License
2.44k stars 622 forks source link

issue while show dropdown in table view after update xcode and os #252

Open NomanUmar opened 4 years ago

NomanUmar commented 4 years ago

we face a issue when want to show dropdown in tableview in older os and xcode work perfactly

saormart commented 2 years ago

I may have the same issue as you... The issue I have is that I have a table view list, with rows and each row I have the Dropdown and a button along with labels and text... The problem with the dropdown is let's say that I have 3 rows in the table view... When I click on the 1st row Dropdown, it seems to execute the ".show" on the 2nd row Dropdown, and when I click on the 2nd row Dropdown it's like has clicked on the 3rd row Dropdown and finally when I click on the last 3rd row Dropdown, it's like you click on the 1st row Dropdown... It's working properly on old iOS like 12 and 13, but seems the 15 have this issue! I'm not sure about version 14.... I don't have a device with that version to test....

saormart commented 2 years ago

Would be great if some one could flag this as a bug! I'm working on it trying to figure out why this is happening with the new iOS 15

saormart commented 2 years ago

Well after hours trying to figure out what was the problem, I found out that's a possible bug on the newer iOS 15 related to the tableview indexpath that's the data is loaded asynchronously ... I though that the problem was with the Xcode, but not... the same project I have it runs perfectly on iOS 12 and 13, but it have this issue on iOS 15, so hope Apple fix this asap!

For now the "hack" to have this working is doing the following code: //Replace this: yourTableView.reloadData() //To this: DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { yourTableView.reloadData() }

Basically you have to add 0.1s before you reload your tableview data until they fix this issue on Xcode....