Skip to content

Commit d4c5c04

Browse files
committed
[FIX] : fix issue (#144) about standard dialog behavior when the user put an absolute existing file path name in dialog input text
1 parent 39520aa commit d4c5c04

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,13 +2536,17 @@ std::string IGFD::FileManager::GetResultingFilePathName(FileDialogInternal& vFil
25362536
auto result = GetResultingPath();
25372537
const auto& filename = GetResultingFileName(vFileDialogInternal, vFlag);
25382538
if (!filename.empty()) {
2539+
if (m_FileSystemPtr != nullptr && m_FileSystemPtr->IsFileExist(filename)) {
2540+
result = filename; // #144, exist file, so absolute, so return it (maybe set by user in inputText)
2541+
} else { // #144, else concate path with current filename
25392542
#ifdef _IGFD_UNIX_
2540-
if (fsRoot != result)
2543+
if (fsRoot != result)
25412544
#endif // _IGFD_UNIX_
2542-
{
2543-
result += IGFD::Utils::GetPathSeparator();
2545+
{
2546+
result += IGFD::Utils::GetPathSeparator();
2547+
}
2548+
result += filename;
25442549
}
2545-
result += filename;
25462550
}
25472551

25482552
return result;

0 commit comments

Comments
 (0)