Skip to content

Conversation

robinshin
Copy link
Contributor

@robinshin robinshin commented Feb 1, 2025

This PR introduces the enableLoadingIndicator prop to provide better control over the visibility of the activity indicator during loading states.

The current implementation has a limitation where the RightIconComponent may visually dangle or shift improperly when transitioning from a loading (true) to not loading (false) state, particularly when using a custom right button with showClear set to false.

The issue arises due to the conditional rendering of the clear button component, which does not account for cases where the loading indicator might be undesirable or visually intrusive. Here’s the problematic segment:

{!loading && showClear && (
  <TouchableOpacity onPress={onClearPress} style={styles.clearButton}>
    {ClearIconComponent ?? <XCircle width={18} stroke="#aeb4c6" />}
  </TouchableOpacity>
)}

With the addition of the enableLoadingIndicator boolean, users will have the flexibility to enable or disable the loading indicator based on their specific needs, thus preventing the unwanted dangling effect of the RightIconComponent during the load transition.

Attached is a video demonstrating the issue with:

  • showClear = false
  • RightIconComponent = <CustomComponent>
Enregistrement.de.l.ecran.2025-02-01.a.20.43.17.mov

@robinshin
Copy link
Contributor Author

Hey @onmotion , could you please review this PR when you have a moment? Thanks!

@onmotion onmotion merged commit 7b0b9ce into onmotion:main Feb 6, 2025
@onmotion
Copy link
Owner

onmotion commented Feb 6, 2025

react-native-autocomplete-dropdown@4.4.0 has been published, thank you @robinshin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants