Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3568: Sets input field value when repository path is updated. #3583

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/renderer/modal/addLocalRepository.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</t-card-header>
<t-card-body>
<inputText
id="pathToRepository"
v-model.trim="pathToRepository"
v-focus
name="pathToRepository"
Expand Down Expand Up @@ -86,6 +87,8 @@ export default {
methods: {
fileSectorInput(event) {
this.pathToRepository = event.target.files[0].path.split("\\").join("/");
var repositoryPathInput = document.getElementById("pathToRepository");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try doing it with refs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using refs first but that didn't fix the issue. I added a ref="repositoryPath" to the inputText element and then put the following code in the fileSectorInput method:

this.$refs.repositoryPath.value = this.pathToRepository;

Do you have any suggestions as to why using the refs didn't work?
Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me take a look into that.

repositoryPathInput.value = this.pathToRepository;
},
addRepository(path) {
if (this.pathToRepository !== "") {
Expand Down